Minor cleanup
This commit is contained in:
parent
d244c16e10
commit
16b987f46f
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user