Merge branch 'master' of https://github.com/Azgaar/Fantasy-Map-Generator into submap-refactoring

This commit is contained in:
Azgaar 2024-10-19 14:03:55 +02:00
commit d19aae59c8
12 changed files with 191 additions and 151 deletions

View file

@ -608,7 +608,7 @@ function overviewBurgs(settings = {stateId: null, cultureId: null}) {
const activeBurgs = pack.burgs.filter(b => b.i && !b.removed);
const allLocked = activeBurgs.every(burg => burg.lock);
pack.burgs.forEach(burg => {
activeBurgs.forEach(burg => {
burg.lock = !allLocked;
});

View file

@ -122,7 +122,7 @@ function editLabel() {
function redrawLabelPath() {
const path = byId("textPath_" + elSelected.attr("id"));
lineGen.curve(d3.curveBundle.beta(1));
lineGen.curve(d3.curveNatural);
const points = [];
debug
.select("#controlPoints")

View file

@ -15,7 +15,7 @@ function editLake() {
debug.append("g").attr("id", "vertices");
elSelected = d3.select(node);
updateLakeValues();
selectLakeGroup(node);
selectLakeGroup();
drawLakeVertices();
viewbox.on("touchmove mousemove", null);
@ -140,13 +140,13 @@ function editLake() {
lake.name = lakeName.value = Names.getBase(rand(nameBases.length - 1));
}
function selectLakeGroup(node) {
const group = node.parentNode.id;
function selectLakeGroup() {
const lake = getLake();
const select = byId("lakeGroup");
select.options.length = 0; // remove all options
lakes.selectAll("g").each(function () {
select.options.add(new Option(this.id, this.id, false, this.id === group));
select.options.add(new Option(this.id, this.id, false, this.id === lake.group));
});
}

View file

@ -341,6 +341,8 @@ function editZones() {
}
function toggleLegend() {
if (legend.selectAll("*").size()) return clearLegend(); // hide legend
const filterBy = byId("zonesFilterType").value;
const isFiltered = filterBy && filterBy !== "all";
const visibleZones = pack.zones.filter(zone => !zone.hidden && (!isFiltered || zone.type === filterBy));