fix: enhance emblem rendering for states and burgs in the editor

This commit is contained in:
Marc Emmanuel 2026-03-05 09:26:20 +01:00
parent 32227518d2
commit 62f95ec04e
2 changed files with 10 additions and 6 deletions

View file

@ -101,14 +101,17 @@ function processFeatureRegeneration(event, button) {
async function openEmblemEditor() { async function openEmblemEditor() {
let type, id, el; let type, id, el;
if (pack.states[1]?.coa) { const firstState = pack.states.find(s => s.i && !s.removed && s.coa);
const firstBurg = pack.burgs.find(b => b.i && !b.removed && b.coa);
if (firstState) {
type = "state"; type = "state";
id = "stateCOA1"; id = `stateCOA${firstState.i}`;
el = pack.states[1]; el = firstState;
} else if (pack.burgs[1]?.coa) { } else if (firstBurg) {
type = "burg"; type = "burg";
id = "burgCOA1"; id = `burgCOA${firstBurg.i}`;
el = pack.burgs[1]; el = firstBurg;
} else { } else {
tip("No emblems to edit, please generate states and burgs first", false, "error"); tip("No emblems to edit, please generate states and burgs first", false, "error");
return; return;

View file

@ -676,6 +676,7 @@ class BurgModule {
}; };
this.definePopulation(burg); this.definePopulation(burg);
this.defineEmblem(burg); this.defineEmblem(burg);
COArenderer.add("burg", burgId, burg.coa, x, y);
this.defineFeatures(burg); this.defineFeatures(burg);
const populations = pack.burgs const populations = pack.burgs