Resolved #1927- changing new game parameters and exiting the new game screen doesn't change the current game's parameters

This commit is contained in:
Yair Morgenstern 2020-02-14 13:15:30 +02:00
parent 5117a9faa4
commit efe200442a
2 changed files with 17 additions and 2 deletions

View File

@ -21,4 +21,19 @@ class GameParameters { // Default values are the default new game
var isOnlineMultiplayer = false
var mods = HashSet<String>()
fun clone(): GameParameters {
val parameters=GameParameters()
parameters.difficulty=difficulty
parameters.gameSpeed=gameSpeed
parameters.players= ArrayList(players)
parameters.numberOfCityStates=numberOfCityStates
parameters.noBarbarians=noBarbarians
parameters.oneCityChallenge=oneCityChallenge
parameters.victoryTypes= ArrayList(victoryTypes)
parameters.startingEra=startingEra
parameters.isOnlineMultiplayer=isOnlineMultiplayer
parameters.mods= HashSet(mods)
return parameters
}
}

View File

@ -13,17 +13,17 @@ import com.unciv.logic.civilization.PlayerType
import com.unciv.models.ruleset.RulesetCache
import com.unciv.models.translations.tr
import com.unciv.ui.pickerscreens.PickerScreen
import com.unciv.ui.utils.Popup
import com.unciv.ui.utils.disable
import com.unciv.ui.utils.enable
import com.unciv.ui.utils.onClick
import com.unciv.ui.worldscreen.mainmenu.OnlineMultiplayer
import com.unciv.ui.utils.Popup
import java.util.*
import kotlin.concurrent.thread
class NewGameScreen: PickerScreen(){
val newGameParameters= UncivGame.Current.gameInfo.gameParameters
val newGameParameters= UncivGame.Current.gameInfo.gameParameters.clone()
val mapParameters = UncivGame.Current.gameInfo.tileMap.mapParameters
val ruleset = RulesetCache.getComplexRuleset(newGameParameters.mods)