diff --git a/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorGenerateTab.kt b/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorGenerateTab.kt index 63e8966451..1b160bf21c 100644 --- a/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorGenerateTab.kt +++ b/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorGenerateTab.kt @@ -66,7 +66,10 @@ class MapEditorGenerateTab( } private fun generate(step: MapGeneratorSteps) { - if (step <= MapGeneratorSteps.Landmass && step in seedUsedForStep) { + if (step == MapGeneratorSteps.All && newTab.mapParametersTable.randomizeSeed) { + newTab.mapParametersTable.reseed() + } + if (step == MapGeneratorSteps.Landmass && step in seedUsedForStep) { // reseed visibly when starting from scratch (new seed shows in advanced settings widget) newTab.mapParametersTable.reseed() seedUsedForStep -= step @@ -92,7 +95,7 @@ class MapEditorGenerateTab( if (step in seedUsedForStep) { mapParameters.reseed() - } else { + } else if (step != MapGeneratorSteps.All){ seedUsedForStep += step } diff --git a/core/src/com/unciv/ui/screens/newgamescreen/MapParametersTable.kt b/core/src/com/unciv/ui/screens/newgamescreen/MapParametersTable.kt index 4c5b019131..c8d8cca16b 100644 --- a/core/src/com/unciv/ui/screens/newgamescreen/MapParametersTable.kt +++ b/core/src/com/unciv/ui/screens/newgamescreen/MapParametersTable.kt @@ -68,6 +68,9 @@ class MapParametersTable( // overrides nor is a Widget a data class. Seems to work anyway. private val advancedSliders = HashMapFloat>() + // used only in map editor (forMapEditor == true) + var randomizeSeed = true + init { update() } @@ -386,6 +389,17 @@ class MapParametersTable( table.add(button).colspan(2).padTop(10f).row() } + fun addCheckBox(text: String, initialState: Boolean, action: ((Boolean) -> Unit)) { + val checkbox = text.toCheckBox(initialState){ + action(it) + } + table.add(checkbox).colspan(2).row() + } + if (forMapEditor) { + addCheckBox("Randomize seed", true) { + randomizeSeed = it + } + } addSlider("Map Elevation", {mapParameters.elevationExponent}, 0.6f, 0.8f) { mapParameters.elevationExponent = it }