diff --git a/core/src/com/unciv/logic/GameStarter.kt b/core/src/com/unciv/logic/GameStarter.kt index 5902754553..da705d6dbd 100644 --- a/core/src/com/unciv/logic/GameStarter.kt +++ b/core/src/com/unciv/logic/GameStarter.kt @@ -24,8 +24,12 @@ object GameStarter { if (gameSetupInfo.mapParameters.name != "") { gameInfo.tileMap = MapSaver.loadMap(gameSetupInfo.mapFile!!) - } else gameInfo.tileMap = MapGenerator(ruleset).generateMap(gameSetupInfo.mapParameters) - gameInfo.tileMap.mapParameters = gameSetupInfo.mapParameters + // Don't override the map parameters - this can include if we world wrap or not! + } else { + gameInfo.tileMap = MapGenerator(ruleset).generateMap(gameSetupInfo.mapParameters) + gameInfo.tileMap.mapParameters = gameSetupInfo.mapParameters + } + gameInfo.tileMap.gameInfo = gameInfo // need to set this transient before placing units in the map addCivilizations(gameSetupInfo.gameParameters, gameInfo, ruleset) // this is before gameInfo.setTransients, so gameInfo doesn't yet have the gameBasics diff --git a/core/src/com/unciv/models/metadata/GameSettings.kt b/core/src/com/unciv/models/metadata/GameSettings.kt index 20efd0d223..6e4e2cba5e 100644 --- a/core/src/com/unciv/models/metadata/GameSettings.kt +++ b/core/src/com/unciv/models/metadata/GameSettings.kt @@ -38,6 +38,8 @@ class GameSettings { var windowState = WindowState() var isFreshlyCreated = false + var showExperimentalWorldWrap = false + init { // 26 = Android Oreo. Versions below may display permanent icon in notification bar. if (Gdx.app?.type == Application.ApplicationType.Android && Gdx.app.version < 26) { diff --git a/core/src/com/unciv/ui/mapeditor/SaveAndLoadMapScreen.kt b/core/src/com/unciv/ui/mapeditor/SaveAndLoadMapScreen.kt index 01fd9567bd..e0de6db034 100644 --- a/core/src/com/unciv/ui/mapeditor/SaveAndLoadMapScreen.kt +++ b/core/src/com/unciv/ui/mapeditor/SaveAndLoadMapScreen.kt @@ -27,6 +27,7 @@ class SaveAndLoadMapScreen(mapToSave: TileMap?, save:Boolean = false) : PickerSc init { if (save) { + rightSideButton.enable() rightSideButton.setText("Save map".tr()) rightSideButton.onClick { mapToSave!!.mapParameters.name = mapNameTextField.text diff --git a/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt b/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt index 6ee89f0340..e0ac22ed2d 100644 --- a/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt @@ -3,6 +3,7 @@ package com.unciv.ui.newgamescreen import com.badlogic.gdx.scenes.scene2d.ui.CheckBox import com.badlogic.gdx.scenes.scene2d.ui.Slider import com.badlogic.gdx.scenes.scene2d.ui.Table +import com.unciv.UncivGame import com.unciv.logic.map.MapParameters import com.unciv.logic.map.MapShape import com.unciv.logic.map.MapSize @@ -31,8 +32,9 @@ class MapParametersTable(val mapParameters: MapParameters, val isEmptyMapAllowed addWorldSizeSelectBox() addNoRuinsCheckbox() addNoNaturalWondersCheckbox() - //uncomment when whole worldWrap feature is added - //addWorldWrapCheckbox() + if (UncivGame.Current.settings.showExperimentalWorldWrap) { + addWorldWrapCheckbox() + } addAdvancedSettings() } diff --git a/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt b/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt index 8d6dda7664..4a9fd28d7f 100644 --- a/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt +++ b/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt @@ -128,6 +128,10 @@ class OptionsPopup(val previousScreen:CameraStageBaseScreen) : Popup(previousScr addHeader("Other options") + addYesNoRow("Show experimental world wrap for maps\nHIGHLY EXPERIMENTAL - YOU HAVE BEEN WARNED!", + settings.showExperimentalWorldWrap) + { settings.showExperimentalWorldWrap = it } + addSoundEffectsVolumeSlider() addMusicVolumeSlider() addTranslationGeneration()