fix: add new army

This commit is contained in:
Azgaar 2024-03-15 01:04:46 +01:00
parent e68f70634a
commit 5803f44b99
3 changed files with 9 additions and 9 deletions

View file

@ -8037,7 +8037,7 @@
<script src="modules/burgs-and-states.js?v=1.97.00"></script>
<script src="modules/routes-generator.js"></script>
<script src="modules/religions-generator.js?v=1.93.08"></script>
<script src="modules/military-generator.js?v=1.96.00"></script>
<script src="modules/military-generator.js?v=1.96.01"></script>
<script src="modules/markers-generator.js?v=1.93.04"></script>
<script src="modules/coa-generator.js?v=1.91.05"></script>
<script src="modules/submap.js?v=1.96.00"></script>

View file

@ -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));

View file

@ -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;