visualizer show first game at start
This commit is contained in:
parent
a1e0279d73
commit
f646d83b0e
2 changed files with 17 additions and 27 deletions
|
@ -7,15 +7,24 @@ const OPTIONS = document.getElementById("options");
|
||||||
|
|
||||||
const game_location = LOCATION + "static/games/mod.ini";
|
const game_location = LOCATION + "static/games/mod.ini";
|
||||||
|
|
||||||
fetch(game_location)
|
if (OPTIONS) {
|
||||||
.then((r) => r.text())
|
fetch(game_location)
|
||||||
.then((response) => {
|
.then((r) => r.text())
|
||||||
if (OPTIONS) {
|
.then((response) => {
|
||||||
parse_ini(response);
|
parse_ini(response);
|
||||||
} else {
|
}).catch(console.error);
|
||||||
console.log("Options is not defined, tera?");
|
} else {
|
||||||
|
const options = document.getElementsByClassName("options");
|
||||||
|
if (options[0]) {
|
||||||
|
const options_div = <HTMLDivElement> options[0];
|
||||||
|
if (options_div.children[0]) {
|
||||||
|
setTimeout(
|
||||||
|
() => options_div.children[0].dispatchEvent(new Event('click')),
|
||||||
|
200,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}).catch(console.error);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function handle(location, name: string) {
|
export function handle(location, name: string) {
|
||||||
set_loading(true);
|
set_loading(true);
|
||||||
|
|
|
@ -373,25 +373,6 @@ function step(time: number) {
|
||||||
|
|
||||||
requestAnimationFrame(step);
|
requestAnimationFrame(step);
|
||||||
}
|
}
|
||||||
set_loading(true);
|
// set_loading(false);
|
||||||
|
|
||||||
requestAnimationFrame(step);
|
requestAnimationFrame(step);
|
||||||
|
|
||||||
|
|
||||||
// import { voronoi, Point } from './voronoi'
|
|
||||||
// function test() {
|
|
||||||
// const points = [
|
|
||||||
// new Point(14, 6),
|
|
||||||
// new Point(13, 11),
|
|
||||||
// new Point(8, 7.5),
|
|
||||||
// new Point(7, 4),
|
|
||||||
// new Point(4, 11),
|
|
||||||
// ];
|
|
||||||
|
|
||||||
// console.log(voronoi(points));
|
|
||||||
// }
|
|
||||||
|
|
||||||
// import { test as dcelt_test } from './dcel';
|
|
||||||
// // dcelt_test();
|
|
||||||
|
|
||||||
// test();
|
|
||||||
|
|
Loading…
Reference in a new issue