Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/scenario.js6
-rw-r--r--src/modules/scenarios.js5
2 files changed, 6 insertions, 5 deletions
diff --git a/src/modules/scenario.js b/src/modules/scenario.js
index 039801d..6ab66db 100644
--- a/src/modules/scenario.js
+++ b/src/modules/scenario.js
@@ -15,11 +15,7 @@ async function loadScript(scenario, svg, script) {
};
const dataset = scenario.querySelector('script')?.dataset || {};
-
- if ('cols' in dataset && 'rows' in dataset) {
- scriptEl.dataset.rows = dataset.rows;
- scriptEl.dataset.cols = dataset.cols;
- }
+ Object.entries(dataset).forEach(([k, v]) => scriptEl.dataset[k] = v);
scriptEl.setAttributeNS(null, 'href', `../../${script}.js`);
svg.append(scriptEl);
diff --git a/src/modules/scenarios.js b/src/modules/scenarios.js
index 2a4af26..a1b0052 100644
--- a/src/modules/scenarios.js
+++ b/src/modules/scenarios.js
@@ -1,6 +1,7 @@
import sideShow from './assets/images/scenario-side_show.svg';
import dragonHunting from './assets/images/scenario-dragon_hunting.svg';
import raceAgainstTime from './assets/images/scenario-race_against_time.svg';
+import map4 from './assets/images/map4.svg';
export const scenarios = {
'scenario-side_show': {
@@ -15,4 +16,8 @@ export const scenarios = {
hashed: raceAgainstTime,
title: 'BattleTroops Scenario 3: Race Against Time',
},
+ 'map4': {
+ hashed: map4,
+ title: 'Test map'
+ }
}