v1.5.42 edit emblem button

This commit is contained in:
Azgaar 2021-02-20 18:10:18 +03:00
parent 66edd3f6c7
commit bd7b7c2a5d
3 changed files with 28 additions and 0 deletions

View file

@ -14,6 +14,7 @@ toolsContent.addEventListener("click", function(event) {
if (button === "editDiplomacyButton") editDiplomacy(); else
if (button === "editCulturesButton") editCultures(); else
if (button === "editReligions") editReligions(); else
if (button === "editEmblemButton") openEmblemEditor(); else
if (button === "editNamesBaseButton") editNamesbase(); else
if (button === "editUnitsButton") editUnits(); else
if (button === "editNotesButton") editNotes(); else
@ -72,6 +73,26 @@ function processFeatureRegeneration(event, button) {
if (button === "regenerateZones") regenerateZones(event);
}
async function openEmblemEditor() {
let type, id, el;
if (pack.states[1]?.coa) {
type = "state";
id = "stateCOA1";
el = pack.states[1];
} else if (pack.burgs[1]?.coa) {
type = "burg";
id = "burgCOA1";
el = pack.burgs[1];
} else {
tip("No emblems to edit, please generate states and burgs first", false, "error");
return;
}
await COArenderer.trigger(id, el.coa);
editEmblem(type, id, el);
}
function regenerateRivers() {
Rivers.generate();
Rivers.specify();