mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
feat: burg group editor - apply changes
This commit is contained in:
parent
b6708bf698
commit
b700bf0630
8 changed files with 102 additions and 29 deletions
|
|
@ -211,6 +211,7 @@ function editBurgGroups() {
|
|||
|
||||
el.previousElementSibling.value = JSON.stringify(values);
|
||||
el.innerHTML = Object.keys(values).length ? "some" : "any";
|
||||
|
||||
$(this).dialog("close");
|
||||
},
|
||||
Cancel: function () {
|
||||
|
|
@ -305,6 +306,14 @@ function editBurgGroups() {
|
|||
return group;
|
||||
});
|
||||
|
||||
// put burgs to new groups
|
||||
const validBurgs = pack.burgs.filter(b => b.i && !b.removed);
|
||||
const populations = validBurgs.map(b => b.population).sort((a, b) => a - b);
|
||||
validBurgs.forEach(burg => Burgs.defineGroup(burg, populations));
|
||||
|
||||
if (layerIsOn("toggleBurgIcons")) drawBurgIcons();
|
||||
if (layerIsOn("toggleLabels")) drawBurgLabels();
|
||||
|
||||
$("#burgGroupsEditor").dialog("close");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue