Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-07-15 14:58:53 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-07-15 14:58:53 -0700
commit5763dccbde60e29a72cfc5bcac16db6a22edf4e7 (patch)
tree39d7bf3e51eba4c1480e50599bc198d24e316d6b /src/modules
parent9b85d20fecd513ccdb33af29cd0cb12f6e1d4595 (diff)
WIP: Render buildings already in gameboard when scenario is loaded
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/scenario.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/modules/scenario.js b/src/modules/scenario.js
index 6ab66db..805d0fe 100644
--- a/src/modules/scenario.js
+++ b/src/modules/scenario.js
@@ -94,11 +94,15 @@ export async function build(svg, request) {
//if (startLocs) grid.before(svg.ownerDocument.importNode(startLocs, true));
const scenarioGrid = scenario.querySelector('.grid');
+ const scenarioBuildings = scenario.querySelector('.gameboard .buildings');
if (scenarioGrid) {
grid.replaceWith(svg.ownerDocument.importNode(scenarioGrid, true));
}
+ if (scenarioBuildings)
+ svg.querySelector('.gameboard .buildings').replaceWith(svg.ownerDocument.importNode(scenarioBuildings, true));
+
await loadScript(scenario, svg, 'radial')
return loadScript(scenario, svg, 'map');
}