diff --git a/frontend/www/games.ts b/frontend/www/games.ts index 0d4b3df..eb5e647 100644 --- a/frontend/www/games.ts +++ b/frontend/www/games.ts @@ -1,5 +1,5 @@ -import { set_loading, LOCATION, set_instance } from './index' +import { set_game_name, set_loading, LOCATION, set_instance } from './index' import { ConfigIniParser } from 'config-ini-parser' const OPTIONS = document.getElementById("options"); @@ -13,13 +13,14 @@ fetch(game_location) parse_ini(response); }).catch(console.error); -export function handle(location) { +export function handle(location, name: string) { set_loading(true); fetch(location) .then((r) => r.text()) .then((response) => { set_instance(response); + set_game_name(name); }).catch(console.error); } @@ -27,7 +28,7 @@ export function handle(location) { function create_option(location: string, name: string, turns: string, players: string): HTMLElement { const div = document.createElement("div"); div.className = "option"; - div.onclick = (_) => handle(location); + div.onclick = (_) => handle(location, name); let ps = ""; @@ -38,7 +39,6 @@ function create_option(location: string, name: string, turns: string, players: s if (index % 2 == 0) { continue; } - console.log(player); ps += `
${player}
`; } } diff --git a/frontend/www/index.html b/frontend/www/index.html index eb9cfda..cdf9660 100644 --- a/frontend/www/index.html +++ b/frontend/www/index.html @@ -11,7 +11,7 @@