index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
author | Catalin Mititiuc <webdevcat@proton.me> | 2024-07-10 17:35:18 -0700 |
---|---|---|
committer | Catalin Mititiuc <webdevcat@proton.me> | 2024-07-10 17:35:18 -0700 |
commit | b3f902f012e04facad489c613b5c577a1788b570 (patch) | |
tree | a0dd26414256b88cd800424cc8cee91a918cb34b /src/radial.js | |
parent | 4cf7aaab807f36721416eedfe5f9fab3f0c55e20 (diff) |
Build scenarios from scenario files
Diffstat (limited to 'src/radial.js')
-rw-r--r-- | src/radial.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/radial.js b/src/radial.js index 7288640..e7811fd 100644 --- a/src/radial.js +++ b/src/radial.js @@ -590,11 +590,28 @@ function findScalar(arr) { }); } +const mapsheets = [mapsheet1, mapsheet2, mapsheet3, mapsheet4].reduce((acc, ms) => { + acc[ms.id] = ms; + return acc; +}, {}); + +console.log(mapsheets); + let sheets = []; +const scenarioMapsheets = document.querySelectorAll('.grid [class^="mapsheet"]'); + +sheets = [...scenarioMapsheets].map(m => { + const [mapName] = m.classList; + return [mapsheets[mapName]]; +}); + +scenarioMapsheets.forEach(el => el.remove()); +document.querySelectorAll('use[href^="#building"]').forEach(el => el.remove()); + // sheets = [[mapsheet1]]; // sheets = [[mapsheet2]]; -sheets = [[mapsheet2], [mapsheet3]]; +// sheets = [[mapsheet2], [mapsheet3]]; // sheets = [[mapsheet2], [mapsheet1], [mapsheet3]]; // drawMapsheet(grid, mapsheet2, vectorAdd({ q: 0, r: 0, s: 0 }, { q: 1, r: -2, s: 1 }, 6)); @@ -628,6 +645,7 @@ findScalar(findMult(sheets)).forEach(([vscalar, row]) => { }) }); + const circle = document.createElementNS(xmlns, 'circle'); circle.setAttributeNS(null, 'r', 5); circle.setAttributeNS(null, 'fill', 'green'); |