mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-11 18:39:43 +07:00
Fix new game Mod nation icons on first open (#5334)
This commit is contained in:
parent
e0e701058d
commit
a487c2c373
@ -28,23 +28,24 @@ class NewGameScreen(
|
||||
|
||||
override val gameSetupInfo = _gameSetupInfo ?: GameSetupInfo.fromSettings()
|
||||
override var ruleset = RulesetCache.getComplexRuleset(gameSetupInfo.gameParameters.mods) // needs to be set because the GameOptionsTable etc. depend on this
|
||||
private val newGameOptionsTable = GameOptionsTable(this, isNarrowerThan4to3()) { desiredCiv: String -> playerPickerTable.update(desiredCiv) }
|
||||
|
||||
// Has to be defined before the mapOptionsTable, since the mapOptionsTable refers to it on init
|
||||
private val playerPickerTable = PlayerPickerTable(
|
||||
this, gameSetupInfo.gameParameters,
|
||||
if (isNarrowerThan4to3()) stage.width - 20f else 0f
|
||||
)
|
||||
private val mapOptionsTable = MapOptionsTable(this)
|
||||
private val newGameOptionsTable: GameOptionsTable
|
||||
private val playerPickerTable: PlayerPickerTable
|
||||
private val mapOptionsTable: MapOptionsTable
|
||||
|
||||
init {
|
||||
updateRuleset() // must come before playerPickerTable so mod nations from fromSettings
|
||||
// Has to be initialized before the mapOptionsTable, since the mapOptionsTable refers to it on init
|
||||
playerPickerTable = PlayerPickerTable(
|
||||
this, gameSetupInfo.gameParameters,
|
||||
if (isNarrowerThan4to3()) stage.width - 20f else 0f
|
||||
)
|
||||
newGameOptionsTable = GameOptionsTable(this, isNarrowerThan4to3()) { desiredCiv: String -> playerPickerTable.update(desiredCiv) }
|
||||
mapOptionsTable = MapOptionsTable(this)
|
||||
setDefaultCloseAction(previousScreen)
|
||||
|
||||
if (isNarrowerThan4to3()) initPortrait()
|
||||
else initLandscape()
|
||||
|
||||
updateRuleset()
|
||||
|
||||
if (UncivGame.Current.settings.lastGameSetup != null) {
|
||||
rightSideGroup.addActorAt(0, VerticalGroup().padBottom(5f))
|
||||
val resetToDefaultsButton = "Reset to defaults".toTextButton()
|
||||
|
Loading…
Reference in New Issue
Block a user