mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-03-22 23:27:23 +01:00
fix: enhance emblem rendering for states and burgs in the editor (#1343)
* fix: enhance emblem rendering for states and burgs in the editor * fix: update tools.js version to 1.112.0 for improved functionality * Update src/index.html Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
32227518d2
commit
634c7dba4b
3 changed files with 11 additions and 7 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue