mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
feat: routes - regenerateRoutes
This commit is contained in:
parent
19723bd513
commit
16b441c5cf
4 changed files with 12 additions and 9 deletions
|
|
@ -2220,10 +2220,7 @@
|
|||
>
|
||||
River
|
||||
</button>
|
||||
<<<<<<< HEAD
|
||||
<button id="addRoute" data-tip="Open route creation dialog" data-shortcut="Shift + 4">Route</button>
|
||||
=======
|
||||
<button id="addRoute" data-tip="Click on map to place a route" data-shortcut="Shift + 4">Route</button>
|
||||
</div>
|
||||
|
||||
<div class="separator">Show</div>
|
||||
|
|
@ -2231,7 +2228,6 @@
|
|||
<button id="overviewCellsButton" data-tip="Click to open Cell details view" data-shortcut="Shift + E">
|
||||
Cells
|
||||
</button>
|
||||
>>>>>>> 00abd5213b446922a60e2053eaca711a6d4067e2
|
||||
<button
|
||||
id="overviewChartsButton"
|
||||
data-tip="Click to open Charts to overview cells data"
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ window.Submap = (function () {
|
|||
BurgsAndStates.drawBurgs();
|
||||
|
||||
stage("Regenerating routes network.");
|
||||
Routes.regenerate();
|
||||
regenerateRoutes();
|
||||
|
||||
drawStates();
|
||||
drawBorders();
|
||||
|
|
|
|||
|
|
@ -113,8 +113,7 @@ function overviewRoutes() {
|
|||
function triggerRouteRemove() {
|
||||
const routeId = +this.parentNode.dataset.id;
|
||||
|
||||
alertMessage.innerHTML = /* html */ `Are you sure you want to remove the route? All tributaries will be auto-removed`;
|
||||
|
||||
alertMessage.innerHTML = `Are you sure you want to remove the route?`;
|
||||
$("#alert").dialog({
|
||||
resizable: false,
|
||||
width: "22em",
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ function processFeatureRegeneration(event, button) {
|
|||
ReliefIcons();
|
||||
if (!layerIsOn("toggleRelief")) toggleRelief();
|
||||
} else if (button === "regenerateRoutes") {
|
||||
Routes.regenerate();
|
||||
regenerateRoutes();
|
||||
if (!layerIsOn("toggleRoutes")) toggleRoutes();
|
||||
} else if (button === "regenerateRivers") regenerateRivers();
|
||||
else if (button === "regeneratePopulation") recalculatePopulation();
|
||||
|
|
@ -116,6 +116,14 @@ async function openEmblemEditor() {
|
|||
editEmblem(type, id, el);
|
||||
}
|
||||
|
||||
function regenerateRoutes() {
|
||||
pack.routes = [];
|
||||
pack.cells.routes = {};
|
||||
routes.selectAll("path").remove();
|
||||
Routes.generate();
|
||||
if (layerIsOn("toggleRoutes")) drawRoutes();
|
||||
}
|
||||
|
||||
function regenerateRivers() {
|
||||
Rivers.generate();
|
||||
Lakes.defineGroup();
|
||||
|
|
@ -430,7 +438,7 @@ function regenerateBurgs() {
|
|||
BurgsAndStates.specifyBurgs();
|
||||
BurgsAndStates.defineBurgFeatures();
|
||||
BurgsAndStates.drawBurgs();
|
||||
Routes.regenerate();
|
||||
regenerateRoutes();
|
||||
|
||||
// remove emblems
|
||||
document.querySelectorAll("[id^=burgCOA]").forEach(el => el.remove());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue