From c0470a807e19be2f876c10f87f6fc22c8b470bc8 Mon Sep 17 00:00:00 2001 From: Exelo Date: Fri, 21 Mar 2025 11:29:32 +0100 Subject: [PATCH 1/4] feat: add z index to loader to override game --- apps/web/src/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/web/src/style.css b/apps/web/src/style.css index 3b45b39..ca24238 100644 --- a/apps/web/src/style.css +++ b/apps/web/src/style.css @@ -7,6 +7,7 @@ font-weight: bold; color: white; position: absolute; + z-index: 1000; display: flex; flex-direction: column; justify-content: center; From 92896ecd07238578809c014ec3bb9db8ed07921b Mon Sep 17 00:00:00 2001 From: Exelo Date: Mon, 10 Nov 2025 07:36:27 +0100 Subject: [PATCH 2/4] feat: enable auto-fix on save for ESLint and Prettier in IDE settings --- .idea/jsLinters/eslint.xml | 6 ++++++ .idea/prettier.xml | 1 + 2 files changed, 7 insertions(+) create mode 100644 .idea/jsLinters/eslint.xml diff --git a/.idea/jsLinters/eslint.xml b/.idea/jsLinters/eslint.xml new file mode 100644 index 0000000..541945b --- /dev/null +++ b/.idea/jsLinters/eslint.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/prettier.xml b/.idea/prettier.xml index b0c1c68..0c83ac4 100644 --- a/.idea/prettier.xml +++ b/.idea/prettier.xml @@ -2,5 +2,6 @@ \ No newline at end of file From 6be711ad883f968b21567b84eadfb799e6c813b1 Mon Sep 17 00:00:00 2001 From: Exelo Date: Mon, 10 Nov 2025 07:36:48 +0100 Subject: [PATCH 3/4] fix: simplify `IGameOptions` and streamline file loading logic --- apps/web/src/index.html | 2 +- apps/web/src/loader/loader.ts | 16 +++------------- apps/web/src/types/game.type.ts | 6 +----- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/apps/web/src/index.html b/apps/web/src/index.html index bc65100..fcb9ca3 100644 --- a/apps/web/src/index.html +++ b/apps/web/src/index.html @@ -5,7 +5,7 @@ Title - +
diff --git a/apps/web/src/loader/loader.ts b/apps/web/src/loader/loader.ts index d8efecb..2663118 100644 --- a/apps/web/src/loader/loader.ts +++ b/apps/web/src/loader/loader.ts @@ -8,26 +8,16 @@ const logger = new Logger("Loader"); export const loadGameFiles = async ( manifest: IExtendedManifest, ): Promise<[IGameOptions["files"], any]> => { - const files = { - assets: new Map(), - wasm: new Map(), - wgsl: new Map(), - }; + const files = new Map(); let mainModule = undefined; logger.info("Starting load game files from cache"); for (const file of manifest.files) { - if (file.path.endsWith(".js")) { + if (file.path === "index.js") { const resModule = await loadScript(file); if (resModule) mainModule = resModule; continue; } - if (file.path.endsWith(".wasm")) { - files.wasm.set(file.path, file.localPath); - } else if (file.path.endsWith(".wgsl")) { - files.wgsl.set(file.path, file.localPath); - } else { - files.assets.set(file.path, file.localPath); - } + files.set(file.path, file.localPath); } if (!mainModule) throw new Error("Could not find main function"); logger.info("Game files loaded"); diff --git a/apps/web/src/types/game.type.ts b/apps/web/src/types/game.type.ts index 2cb5425..0b96b84 100644 --- a/apps/web/src/types/game.type.ts +++ b/apps/web/src/types/game.type.ts @@ -1,8 +1,4 @@ export interface IGameOptions { canvas: HTMLCanvasElement; - files: { - assets: Map; - wasm: Map; - wgsl: Map; - }; + files: Map; } From c6ff3ce59bf37bc285c0ffcc23787e98e158d096 Mon Sep 17 00:00:00 2001 From: Exelo Date: Tue, 11 Nov 2025 07:49:43 +0100 Subject: [PATCH 4/4] fix: correct file path check for main module loading --- apps/web/src/loader/loader.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/loader/loader.ts b/apps/web/src/loader/loader.ts index 2663118..595e579 100644 --- a/apps/web/src/loader/loader.ts +++ b/apps/web/src/loader/loader.ts @@ -12,7 +12,7 @@ export const loadGameFiles = async ( let mainModule = undefined; logger.info("Starting load game files from cache"); for (const file of manifest.files) { - if (file.path === "index.js") { + if (file.path === "/index.js") { const resModule = await loadScript(file); if (resModule) mainModule = resModule; continue;