mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 02:01:22 +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
|
|
@ -189,7 +189,7 @@ window.Burgs = (() => {
|
|||
.sort((a, b) => a - b); // ascending
|
||||
|
||||
pack.burgs.forEach(burg => {
|
||||
if (!burg.i || burg.removed || burg.lock) return;
|
||||
if (!burg.i || burg.removed) return;
|
||||
defineGroup(burg, populations);
|
||||
});
|
||||
|
||||
|
|
@ -318,6 +318,12 @@ window.Burgs = (() => {
|
|||
];
|
||||
|
||||
function defineGroup(burg, populations) {
|
||||
if (burg.lock) {
|
||||
// locked bugrgs: don't change group if it still exists
|
||||
const group = options.burgs.groups.find(g => g.name === burg.group);
|
||||
if (group) return;
|
||||
}
|
||||
|
||||
for (const group of options.burgs.groups) {
|
||||
if (!group.active) continue;
|
||||
|
||||
|
|
@ -404,5 +410,5 @@ window.Burgs = (() => {
|
|||
return burgId;
|
||||
}
|
||||
|
||||
return {generate, getDefaultGroups, specify, getType, add};
|
||||
return {generate, getDefaultGroups, specify, defineGroup, getType, add};
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue