index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/index.js b/src/index.js index 6b7e930..6e98028 100644 --- a/src/index.js +++ b/src/index.js @@ -18,7 +18,8 @@ const mapPlaceholder = document.querySelector('.map-placeholder'), distanceOutput = document.getElementById('status'), proneToggle = document.getElementById('toggle-prone-counter'), contentVisToggleEl = document.querySelector('#content input[type="checkbox"].visible'), - fileName = localStorage.getItem('map') || 'scenario-side_show', + // fileName = localStorage.getItem('map') || 'scenario-side_show', + fileName = localStorage.getItem('map') || 'radial', map = scenarios[fileName]?.hashed || `assets/images/${fileName}.svg`, fileInputEl = document.querySelector('input[type="file"]'), dice = document.querySelectorAll('.die'), @@ -64,6 +65,7 @@ async function buildScenario(req) { panzoom.start(svg); gameboard.start(svg); + recordSheet.start(svg.querySelector('.start-locations'), gameboard.getUnits()); } @@ -206,6 +208,14 @@ document.querySelector('#roll-dice').addEventListener('click', () => { }); }); +// document.querySelectorAll('[name="select-elevation"]').forEach(el => { +// const gameboard = document.querySelector('.gameboard'); + +// el.addEventListener('change', function (e) { +// gameboard.dataset.viewElevation = this.value +// }); +// }); + contentVisToggleEl.addEventListener('input', toggleContentVis); contentVisToggleEl.checked = (localStorage.getItem('content-visibility') !== 'false'); toggleContentVis(); |