mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
fix: regenerate burgs to re-render layers
This commit is contained in:
parent
50c6c56461
commit
b142df8f0a
5 changed files with 8 additions and 2 deletions
|
|
@ -948,6 +948,7 @@ export function resolveVersionConflicts(mapVersion) {
|
||||||
Provinces.getPoles();
|
Provinces.getPoles();
|
||||||
|
|
||||||
// v1.104.00 removed some layers from initial render
|
// v1.104.00 removed some layers from initial render
|
||||||
|
viewbox.select("#icons").style("display", null);
|
||||||
viewbox.select("#armies").style("display", null);
|
viewbox.select("#armies").style("display", null);
|
||||||
viewbox.select("#ice").style("display", null);
|
viewbox.select("#ice").style("display", null);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
function drawBurgIcons() {
|
function drawBurgIcons() {
|
||||||
TIME && console.time("drawBurgIcons");
|
TIME && console.time("drawBurgIcons");
|
||||||
|
|
||||||
|
icons.selectAll("circle, use").remove(); // cleanup
|
||||||
|
|
||||||
// capitals
|
// capitals
|
||||||
const capitals = pack.burgs.filter(b => b.capital && !b.removed);
|
const capitals = pack.burgs.filter(b => b.capital && !b.removed);
|
||||||
const capitalIcons = burgIcons.select("#cities");
|
const capitalIcons = burgIcons.select("#cities");
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
function drawBurgLabels() {
|
function drawBurgLabels() {
|
||||||
TIME && console.time("drawBurgLabels");
|
TIME && console.time("drawBurgLabels");
|
||||||
|
|
||||||
|
burgLabels.selectAll("text").remove(); // cleanup
|
||||||
|
|
||||||
const capitals = pack.burgs.filter(b => b.capital && !b.removed);
|
const capitals = pack.burgs.filter(b => b.capital && !b.removed);
|
||||||
const capitalSize = burgIcons.select("#cities").attr("size") || 1;
|
const capitalSize = burgIcons.select("#cities").attr("size") || 1;
|
||||||
burgLabels
|
burgLabels
|
||||||
|
|
|
||||||
|
|
@ -895,14 +895,12 @@ function drawLabels() {
|
||||||
function toggleBurgIcons(event) {
|
function toggleBurgIcons(event) {
|
||||||
if (!layerIsOn("toggleBurgIcons")) {
|
if (!layerIsOn("toggleBurgIcons")) {
|
||||||
turnButtonOn("toggleBurgIcons");
|
turnButtonOn("toggleBurgIcons");
|
||||||
$("#icons").fadeIn();
|
|
||||||
drawBurgIcons();
|
drawBurgIcons();
|
||||||
if (event && isCtrlClick(event)) editStyle("burgIcons");
|
if (event && isCtrlClick(event)) editStyle("burgIcons");
|
||||||
} else {
|
} else {
|
||||||
if (event && isCtrlClick(event)) return editStyle("burgIcons");
|
if (event && isCtrlClick(event)) return editStyle("burgIcons");
|
||||||
turnButtonOff("toggleBurgIcons");
|
turnButtonOff("toggleBurgIcons");
|
||||||
icons.selectAll("circle, use").remove();
|
icons.selectAll("circle, use").remove();
|
||||||
$("#icons").fadeOut();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -444,6 +444,9 @@ function regenerateBurgs() {
|
||||||
BurgsAndStates.defineBurgFeatures();
|
BurgsAndStates.defineBurgFeatures();
|
||||||
regenerateRoutes();
|
regenerateRoutes();
|
||||||
|
|
||||||
|
drawBurgIcons();
|
||||||
|
drawBurgLabels();
|
||||||
|
|
||||||
// remove emblems
|
// remove emblems
|
||||||
document.querySelectorAll("[id^=burgCOA]").forEach(el => el.remove());
|
document.querySelectorAll("[id^=burgCOA]").forEach(el => el.remove());
|
||||||
emblems.selectAll("use").remove();
|
emblems.selectAll("use").remove();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue