mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-22 13:49:54 +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 != "") {
|
if (gameSetupInfo.mapParameters.name != "") {
|
||||||
gameInfo.tileMap = MapSaver.loadMap(gameSetupInfo.mapFile!!)
|
gameInfo.tileMap = MapSaver.loadMap(gameSetupInfo.mapFile!!)
|
||||||
} else gameInfo.tileMap = MapGenerator(ruleset).generateMap(gameSetupInfo.mapParameters)
|
// Don't override the map parameters - this can include if we world wrap or not!
|
||||||
gameInfo.tileMap.mapParameters = gameSetupInfo.mapParameters
|
} 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
|
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
|
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 windowState = WindowState()
|
||||||
var isFreshlyCreated = false
|
var isFreshlyCreated = false
|
||||||
|
|
||||||
|
var showExperimentalWorldWrap = false
|
||||||
|
|
||||||
init {
|
init {
|
||||||
// 26 = Android Oreo. Versions below may display permanent icon in notification bar.
|
// 26 = Android Oreo. Versions below may display permanent icon in notification bar.
|
||||||
if (Gdx.app?.type == Application.ApplicationType.Android && Gdx.app.version < 26) {
|
if (Gdx.app?.type == Application.ApplicationType.Android && Gdx.app.version < 26) {
|
||||||
|
@ -27,6 +27,7 @@ class SaveAndLoadMapScreen(mapToSave: TileMap?, save:Boolean = false) : PickerSc
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
if (save) {
|
if (save) {
|
||||||
|
rightSideButton.enable()
|
||||||
rightSideButton.setText("Save map".tr())
|
rightSideButton.setText("Save map".tr())
|
||||||
rightSideButton.onClick {
|
rightSideButton.onClick {
|
||||||
mapToSave!!.mapParameters.name = mapNameTextField.text
|
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.CheckBox
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Slider
|
import com.badlogic.gdx.scenes.scene2d.ui.Slider
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
||||||
|
import com.unciv.UncivGame
|
||||||
import com.unciv.logic.map.MapParameters
|
import com.unciv.logic.map.MapParameters
|
||||||
import com.unciv.logic.map.MapShape
|
import com.unciv.logic.map.MapShape
|
||||||
import com.unciv.logic.map.MapSize
|
import com.unciv.logic.map.MapSize
|
||||||
@ -31,8 +32,9 @@ class MapParametersTable(val mapParameters: MapParameters, val isEmptyMapAllowed
|
|||||||
addWorldSizeSelectBox()
|
addWorldSizeSelectBox()
|
||||||
addNoRuinsCheckbox()
|
addNoRuinsCheckbox()
|
||||||
addNoNaturalWondersCheckbox()
|
addNoNaturalWondersCheckbox()
|
||||||
//uncomment when whole worldWrap feature is added
|
if (UncivGame.Current.settings.showExperimentalWorldWrap) {
|
||||||
//addWorldWrapCheckbox()
|
addWorldWrapCheckbox()
|
||||||
|
}
|
||||||
addAdvancedSettings()
|
addAdvancedSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,6 +128,10 @@ class OptionsPopup(val previousScreen:CameraStageBaseScreen) : Popup(previousScr
|
|||||||
|
|
||||||
addHeader("Other options")
|
addHeader("Other options")
|
||||||
|
|
||||||
|
addYesNoRow("Show experimental world wrap for maps\nHIGHLY EXPERIMENTAL - YOU HAVE BEEN WARNED!",
|
||||||
|
settings.showExperimentalWorldWrap)
|
||||||
|
{ settings.showExperimentalWorldWrap = it }
|
||||||
|
|
||||||
addSoundEffectsVolumeSlider()
|
addSoundEffectsVolumeSlider()
|
||||||
addMusicVolumeSlider()
|
addMusicVolumeSlider()
|
||||||
addTranslationGeneration()
|
addTranslationGeneration()
|
||||||
|
Reference in New Issue
Block a user