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/radial.js')
-rw-r--r-- | src/radial.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/radial.js b/src/radial.js index ca79c35..7288640 100644 --- a/src/radial.js +++ b/src/radial.js @@ -16,7 +16,7 @@ function toKey({ q, r, s, t = 0 } = {}) { function fromKey(key) { const split = key.split(','); - return { q: +split[0], r: +split[1], s: +split[2], t: +(split[3] || 1) }; + return { q: +split[0], r: +split[1], s: +split[2], t: +(split[3] || 0) }; } function sameSigns(a, b) { @@ -93,7 +93,7 @@ function drawHexes(el, list, renderText = false) { use.setAttributeNS(null, 'href', '#hex'); cell.appendChild(use); - if (false) addHexText(q, r, s, t).forEach(txt => cell.appendChild(txt)); + if (renderText) addHexText(q, r, s, t).forEach(txt => cell.appendChild(txt)); list.set(key, cell); el.appendChild(cell); @@ -437,7 +437,7 @@ function drawBuildings(buildings, container, { q: pq, r: pr, s: ps }, features) buildingContainer.appendChild(hexContainer); buildingGrid = translateCoords(buildingGrid, ({ q, r, s }) => ({ q, r, s, t: elevationLevel })); - drawHexes(hexContainer, buildingGrid, true); + drawHexes(hexContainer, buildingGrid); acc = new Map([...acc, ...buildingGrid]); }); @@ -503,7 +503,7 @@ function drawMapsheet(gameboard, mapsheet, position) { ); for ([coords, v] of buildingHexes) grid.delete(coords); - drawHexes(gridContainer, grid, true); + drawHexes(gridContainer, grid); (mapsheet.features || []).forEach(feature => { const featureContainer = document.createElementNS(xmlns, 'g'); |