mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 10:01:23 +01:00
fix: redraw population on change
This commit is contained in:
parent
cf5e75b561
commit
8907cd62ec
6 changed files with 8 additions and 0 deletions
|
|
@ -485,6 +485,7 @@ function applyPopulationChange(oldRural, oldUrban, newRural, newUrban, culture)
|
|||
burgs.forEach(b => (b.population = population));
|
||||
}
|
||||
|
||||
if (layerIsOn("togglePopulation")) drawPopulation();
|
||||
refreshCulturesEditor();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -462,6 +462,7 @@ function changePopulation() {
|
|||
burgs.forEach(b => (b.population = population));
|
||||
}
|
||||
|
||||
if (layerIsOn("togglePopulation")) drawPopulation();
|
||||
refreshReligionsEditor();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -543,6 +543,7 @@ function changePopulation(stateId) {
|
|||
burgs.forEach(b => (b.population = population));
|
||||
}
|
||||
|
||||
if (layerIsOn("togglePopulation")) drawPopulation();
|
||||
refreshStatesEditor();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -454,6 +454,7 @@ function editProvinces() {
|
|||
p.burgs.forEach(b => (pack.burgs[b].population = population));
|
||||
}
|
||||
|
||||
if (layerIsOn("togglePopulation")) drawPopulation();
|
||||
refreshProvincesEditor();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@ function regenerateRivers() {
|
|||
|
||||
function recalculatePopulation() {
|
||||
rankCells();
|
||||
|
||||
pack.burgs.forEach(b => {
|
||||
if (!b.i || b.removed || b.lock) return;
|
||||
const i = b.cell;
|
||||
|
|
@ -144,6 +145,8 @@ function recalculatePopulation() {
|
|||
if (b.port) b.population = b.population * 1.3; // increase port population
|
||||
b.population = rn(b.population * gauss(2, 3, 0.6, 20, 3), 3);
|
||||
});
|
||||
|
||||
if (layerIsOn("togglePopulation")) drawPopulation();
|
||||
}
|
||||
|
||||
function regenerateStates() {
|
||||
|
|
|
|||
|
|
@ -472,6 +472,7 @@ function editZones() {
|
|||
burgs.forEach(b => (b.population = population));
|
||||
}
|
||||
|
||||
if (layerIsOn("togglePopulation")) drawPopulation();
|
||||
zonesEditorAddLines();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue