From 5803f44b996f6c2727610dc9faca2d73f05b4fa6 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Fri, 15 Mar 2024 01:04:46 +0100 Subject: [PATCH] fix: add new army --- index.html | 2 +- modules/military-generator.js | 14 +++++++------- versioning.js | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 9ac253c8..f9b54ef9 100644 --- a/index.html +++ b/index.html @@ -8037,7 +8037,7 @@ - + diff --git a/modules/military-generator.js b/modules/military-generator.js index be56658f..a480bfaa 100644 --- a/modules/military-generator.js +++ b/modules/military-generator.js @@ -381,29 +381,29 @@ window.Military = (function () { .text(d => d.icon); }; - const drawRegiment = function (reg, s) { + const drawRegiment = function (reg, stateId) { const size = +armies.attr("box-size"); const w = reg.n ? size * 4 : size * 6; const h = size * 2; const x1 = rn(reg.x - w / 2, 2); const y1 = rn(reg.y - size, 2); - let army = armies.select("g#army" + s); + let army = armies.select("g#army" + stateId); if (!army.size()) { - const baseColor = pack.states[s].color[0] === "#" ? pack.states[s].color : "#999"; - const darkerColor = d3.color(army.attr("fill")).darker().hex(); + const baseColor = pack.states[stateId].color[0] === "#" ? pack.states[stateId].color : "#999"; + const darkerColor = d3.color(baseColor).darker().hex(); army = armies .append("g") - .attr("id", "army" + s) + .attr("id", "army" + stateId) .attr("fill", baseColor) .attr("color", darkerColor); } const g = army .append("g") - .attr("id", "regiment" + s + "-" + reg.i) + .attr("id", "regiment" + stateId + "-" + reg.i) .attr("data-name", reg.name) - .attr("data-state", s) + .attr("data-state", stateId) .attr("data-id", reg.i); g.append("rect").attr("x", x1).attr("y", y1).attr("width", w).attr("height", h); g.append("text").attr("x", reg.x).attr("y", reg.y).text(getTotal(reg)); diff --git a/versioning.js b/versioning.js index 6b7cc11d..0c547679 100644 --- a/versioning.js +++ b/versioning.js @@ -1,7 +1,7 @@ "use strict"; // version and caching control -const version = "1.97.00"; // generator version, update each time +const version = "1.97.01"; // generator version, update each time { document.title += " v" + version;