mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-03-22 15:17:23 +01:00
fix: enhance emblem rendering for states and burgs in the editor
This commit is contained in:
parent
32227518d2
commit
62f95ec04e
2 changed files with 10 additions and 6 deletions
|
|
@ -101,14 +101,17 @@ function processFeatureRegeneration(event, button) {
|
|||
async function openEmblemEditor() {
|
||||
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";
|
||||
id = "stateCOA1";
|
||||
el = pack.states[1];
|
||||
} else if (pack.burgs[1]?.coa) {
|
||||
id = `stateCOA${firstState.i}`;
|
||||
el = firstState;
|
||||
} else if (firstBurg) {
|
||||
type = "burg";
|
||||
id = "burgCOA1";
|
||||
el = pack.burgs[1];
|
||||
id = `burgCOA${firstBurg.i}`;
|
||||
el = firstBurg;
|
||||
} else {
|
||||
tip("No emblems to edit, please generate states and burgs first", false, "error");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -676,6 +676,7 @@ class BurgModule {
|
|||
};
|
||||
this.definePopulation(burg);
|
||||
this.defineEmblem(burg);
|
||||
COArenderer.add("burg", burgId, burg.coa, x, y);
|
||||
this.defineFeatures(burg);
|
||||
|
||||
const populations = pack.burgs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue