mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -04:00
Fixed a crash when changing the base ruleset while in portrait mode (#5671)
* Fixed a crash when changing the base ruleset while in portrait mode * Whoops
This commit is contained in:
parent
f3115d9f03
commit
5a458e93cb
@ -15,13 +15,14 @@ import com.unciv.ui.utils.*
|
||||
|
||||
class GameOptionsTable(
|
||||
val previousScreen: IPreviousScreen,
|
||||
val withoutMods: Boolean = false,
|
||||
val isPortrait: Boolean = false,
|
||||
val updatePlayerPickerTable:(desiredCiv:String)->Unit
|
||||
) : Table(CameraStageBaseScreen.skin) {
|
||||
var gameParameters = previousScreen.gameSetupInfo.gameParameters
|
||||
val ruleset = previousScreen.ruleset
|
||||
var locked = false
|
||||
private var modCheckboxes: ModCheckboxTable? = null
|
||||
var modCheckboxes: ModCheckboxTable? = null
|
||||
private set;
|
||||
|
||||
init {
|
||||
getGameOptionsTable()
|
||||
@ -38,7 +39,11 @@ class GameOptionsTable(
|
||||
defaults().pad(5f)
|
||||
|
||||
// We assign this first to make sure addBaseRulesetSelectBox doesn't reference a null object
|
||||
if (!withoutMods) modCheckboxes = getModCheckboxes()
|
||||
if (isPortrait) {
|
||||
modCheckboxes = getModCheckboxes(isPortrait = true)
|
||||
} else {
|
||||
modCheckboxes = getModCheckboxes()
|
||||
}
|
||||
|
||||
add(Table().apply {
|
||||
defaults().pad(5f)
|
||||
@ -62,7 +67,8 @@ class GameOptionsTable(
|
||||
checkboxTable.addReligionCheckbox(cityStateSlider)
|
||||
add(checkboxTable).center().row()
|
||||
|
||||
if (!withoutMods) add(modCheckboxes).row()
|
||||
if (!isPortrait)
|
||||
add(modCheckboxes).row()
|
||||
|
||||
pack()
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ class NewGameScreen(
|
||||
}).expandX().fillX().row()
|
||||
topTable.addSeparator(Color.DARK_GRAY, height = 1f)
|
||||
|
||||
topTable.add(newGameOptionsTable.getModCheckboxes(isPortrait = true)).expandX().fillX().row()
|
||||
topTable.add(newGameOptionsTable.modCheckboxes).expandX().fillX().row()
|
||||
topTable.addSeparator(Color.DARK_GRAY, height = 1f)
|
||||
|
||||
topTable.add(ExpanderTab("Map Options") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user