mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 13:27:22 -04: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 val gameSetupInfo = _gameSetupInfo ?: GameSetupInfo.fromSettings()
|
||||||
override var ruleset = RulesetCache.getComplexRuleset(gameSetupInfo.gameParameters.mods) // needs to be set because the GameOptionsTable etc. depend on this
|
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) }
|
private val newGameOptionsTable: GameOptionsTable
|
||||||
|
private val playerPickerTable: PlayerPickerTable
|
||||||
// Has to be defined before the mapOptionsTable, since the mapOptionsTable refers to it on init
|
private val mapOptionsTable: MapOptionsTable
|
||||||
private val playerPickerTable = PlayerPickerTable(
|
|
||||||
this, gameSetupInfo.gameParameters,
|
|
||||||
if (isNarrowerThan4to3()) stage.width - 20f else 0f
|
|
||||||
)
|
|
||||||
private val mapOptionsTable = MapOptionsTable(this)
|
|
||||||
|
|
||||||
init {
|
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)
|
setDefaultCloseAction(previousScreen)
|
||||||
|
|
||||||
if (isNarrowerThan4to3()) initPortrait()
|
if (isNarrowerThan4to3()) initPortrait()
|
||||||
else initLandscape()
|
else initLandscape()
|
||||||
|
|
||||||
updateRuleset()
|
|
||||||
|
|
||||||
if (UncivGame.Current.settings.lastGameSetup != null) {
|
if (UncivGame.Current.settings.lastGameSetup != null) {
|
||||||
rightSideGroup.addActorAt(0, VerticalGroup().padBottom(5f))
|
rightSideGroup.addActorAt(0, VerticalGroup().padBottom(5f))
|
||||||
val resetToDefaultsButton = "Reset to defaults".toTextButton()
|
val resetToDefaultsButton = "Reset to defaults".toTextButton()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user