From aab037b409ffccb7274c763b17bca68d89c60d65 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sat, 13 Mar 2021 22:39:57 +0200 Subject: [PATCH] Resolved #3691 - 'new map' from map editor copies existing map parameters --- core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt | 2 +- core/src/com/unciv/ui/mapeditor/NewMapScreen.kt | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt b/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt index 0037499845..caa86d791e 100644 --- a/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt +++ b/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt @@ -14,7 +14,7 @@ import com.unciv.ui.utils.* class MapEditorMenuPopup(var mapEditorScreen: MapEditorScreen): Popup(mapEditorScreen) { init { - addButton("New map") { UncivGame.Current.setScreen(NewMapScreen()) } + addButton("New map") { UncivGame.Current.setScreen(NewMapScreen(mapEditorScreen.tileMap.mapParameters)) } addButton("Save map") { mapEditorScreen.game.setScreen(SaveAndLoadMapScreen(mapEditorScreen.tileMap, true)) } addButton("Load map") { mapEditorScreen.game.setScreen(SaveAndLoadMapScreen(mapEditorScreen.tileMap)) } addButton("Exit map editor") { mapEditorScreen.game.setScreen(MainMenuScreen()); mapEditorScreen.dispose() } diff --git a/core/src/com/unciv/ui/mapeditor/NewMapScreen.kt b/core/src/com/unciv/ui/mapeditor/NewMapScreen.kt index 293d984fbc..7090e37e3f 100644 --- a/core/src/com/unciv/ui/mapeditor/NewMapScreen.kt +++ b/core/src/com/unciv/ui/mapeditor/NewMapScreen.kt @@ -18,9 +18,8 @@ import kotlin.concurrent.thread import com.unciv.ui.utils.AutoScrollPane as ScrollPane /** New map generation screen */ -class NewMapScreen : PickerScreen() { +class NewMapScreen(val mapParameters: MapParameters = MapParameters()) : PickerScreen() { - private val mapParameters = MapParameters() private val ruleset = RulesetCache.getBaseRuleset() private var generatedMap: TileMap? = null