mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 02:01:22 +01:00
fix: auto-update - ensure 1 group is default
This commit is contained in:
parent
f51c45e17a
commit
b5bb18235f
1 changed files with 10 additions and 1 deletions
|
|
@ -986,7 +986,8 @@ export function resolveVersionConflicts(mapVersion) {
|
|||
|
||||
burgIcons.selectAll("g").each(function (_el, index) {
|
||||
const name = this.id;
|
||||
options.burgs.groups.push({name, active: true, order: index + 1, preview: "watabou-city"});
|
||||
const isDefault = name === "towns";
|
||||
options.burgs.groups.push({name, active: true, order: index + 1, isDefault, preview: "watabou-city"});
|
||||
|
||||
const size = Number(this.getAttribute("size") || 2) * 2;
|
||||
this.removeAttribute("size");
|
||||
|
|
@ -995,6 +996,14 @@ export function resolveVersionConflicts(mapVersion) {
|
|||
this.setAttribute("stroke-width", 10);
|
||||
});
|
||||
|
||||
if (!options.burgs.groups.length) {
|
||||
options.burgs.groups = Burgs.getDefaultGroups();
|
||||
}
|
||||
|
||||
if (options.burgs.groups.filter(g => g.isDefault).length === 0) {
|
||||
options.burgs.groups[0].isDefault = true;
|
||||
}
|
||||
|
||||
anchors.selectAll("g").each(function () {
|
||||
const size = Number(this.getAttribute("size") || 1);
|
||||
this.removeAttribute("size");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue