From 6a28fa3b6666bf578be1b81f532e1495a3ca1770 Mon Sep 17 00:00:00 2001 From: Exund Date: Thu, 10 Sep 2020 01:45:55 +0200 Subject: [PATCH] Loading fixes --- src/js/GeoZ/main.js | 18 +++++++++--------- src/js/main.js | 16 +++++++++------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/js/GeoZ/main.js b/src/js/GeoZ/main.js index 00f6c1c8..754e1007 100644 --- a/src/js/GeoZ/main.js +++ b/src/js/GeoZ/main.js @@ -231,20 +231,20 @@ export async function initMods() { T.buildings[base_id][variant] = translations.variants[variant]; } } - - if(mod.shapes) { - mod_infos += `${mod.shapes.length} shapes, `; - for (const shape of mod.shapes) { - ModShapes.push(shape); - allShapeData[shape.id] = shape; - } + } + + if(mod.shapes) { + mod_infos += `${mod.shapes.length} shapes, `; + for (const shape of mod.shapes) { + ModShapes.push(shape); + allShapeData[shape.id] = shape; } - } + } logger.log(mod_infos); } initShapes(); - + logger.log(`${Mods.length} mods loaded`); } diff --git a/src/js/main.js b/src/js/main.js index 48393e2b..f30ce8b8 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -47,13 +47,6 @@ console.log("%cDEVCODE BUILT IN", "color: #f77"); logSection("Boot Process", "#f9a825"); -initMods(); -initDrawUtils(); -initComponentRegistry(); -initItemRegistry(); -initMetaBuildingRegistry(); -initGameSpeedRegistry(); - let app = null; function bootApp() { @@ -62,4 +55,13 @@ function bootApp() { app.boot(); } +(async () => { + await initMods(); + initDrawUtils(); + initComponentRegistry(); + initItemRegistry(); + initMetaBuildingRegistry(); + initGameSpeedRegistry(); +})(); + window.addEventListener("load", bootApp); \ No newline at end of file