diff --git a/modules/burgs-and-states.js b/modules/burgs-and-states.js index d879e3d9..8441929c 100644 --- a/modules/burgs-and-states.js +++ b/modules/burgs-and-states.js @@ -378,9 +378,9 @@ window.BurgsAndStates = (() => { const queue = new PriorityQueue({comparator: (a, b) => a.p - b.p}); const cost = []; - const globalNeutralRate = byId("growthRate").valueAsNumber || 1; - const statesNeutralRate = byId("statesNeutral")?.valueAsNumber || 1; - const neutral = (cells.i.length / 2) * globalNeutralRate * statesNeutralRate; // limit cost for state growth + const globalGrowthRate = byId("growthRate").valueAsNumber || 1; + const statesGrowthRate = byId("statesGrowthRate")?.valueAsNumber || 1; + const growthRate = (cells.i.length / 2) * globalGrowthRate * statesGrowthRate; // limit cost for state growth // remove state from all cells except of locked for (const cellId of cells.i) { @@ -419,7 +419,7 @@ window.BurgsAndStates = (() => { const cellCost = Math.max(cultureCost + populationCost + biomeCost + heightCost + riverCost + typeCost, 0); const totalCost = p + 10 + cellCost / states[s].expansionism; - if (totalCost > neutral) return; + if (totalCost > growthRate) return; if (!cost[e] || totalCost < cost[e]) { if (cells.h[e] >= 20) cells.state[e] = s; // assign state to cell diff --git a/modules/dynamic/editors/states-editor.js b/modules/dynamic/editors/states-editor.js index 4c3f81e3..a70af899 100644 --- a/modules/dynamic/editors/states-editor.js +++ b/modules/dynamic/editors/states-editor.js @@ -55,36 +55,18 @@ function insertEditorHtml() { @@ -118,8 +100,7 @@ function addListeners() { byId("statesRegenerateBack").on("click", exitRegenerationMenu); byId("statesRecalculate").on("click", () => recalculateStates(true)); byId("statesRandomize").on("click", randomizeStatesExpansion); - byId("statesNeutral").on("input", changeStatesGrowthRate); - byId("statesNeutralNumber").on("change", changeStatesGrowthRate); + byId("statesGrowthRate").on("input", () => recalculateStates(false)); byId("statesManually").on("click", enterStatesManualAssignent); byId("statesManuallyApply").on("click", applyStatesManualAssignent); byId("statesManuallyCancel").on("click", () => exitStatesManualAssignment(false)); @@ -868,14 +849,6 @@ function recalculateStates(must) { refreshStatesEditor(); } -function changeStatesGrowthRate() { - const growthRate = +this.value; - byId("statesNeutral").value = growthRate; - byId("statesNeutralNumber").value = growthRate; - tip("Growth rate: " + growthRate); - recalculateStates(false); -} - function randomizeStatesExpansion() { pack.states.forEach(s => { if (!s.i || s.removed) return;