mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-20 12:48:56 +07:00
Added World Wrap as a game setting, so bleeding edge users can test it
Can now create maps as World Wrap maps and play with them :)
This commit is contained in:
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
|
Reference in New Issue
Block a user