custom pictures for regiments (#1183)

* forms and ajustements

* variable size for style as requested
This commit is contained in:
Issac411 2025-01-19 23:29:27 +01:00 committed by GitHub
parent 5bb33311fb
commit 7b8ffd025f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 117 additions and 15 deletions

View file

@ -458,7 +458,20 @@ async function parseLoadedData(data, mapVersion) {
if (isVisible(ruler)) turnOn("toggleRulers");
if (isVisible(scaleBar)) turnOn("toggleScaleBar");
if (isVisibleNode(byId("vignette"))) turnOn("toggleVignette");
window.uniquePictures = [];
window.iconReload = true;
$("#armies").each(function(id, armyGroup) {
$(armyGroup).children().each(function(aId, army){
$(army).children().each(function(rId, regiment){
if($(regiment).find(".regimentImage").length !== 0 && $(regiment).find(".regimentImage").attr('href')) {
let icon = $(regiment).find(".regimentImage").attr('href');
window.uniquePictures.push(icon);
}
});
});
});
window.uniquePictures = [...new Set(uniquePictures)];
getCurrentPreset();
}