mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
Resolved crashes in game options table when changing base ruleset before the mod list was defined
This commit is contained in:
parent
eefe499fff
commit
4b43ff5b5e
@ -37,6 +37,9 @@ class GameOptionsTable(
|
|||||||
top()
|
top()
|
||||||
defaults().pad(5f)
|
defaults().pad(5f)
|
||||||
|
|
||||||
|
// We assign this first to make sure addBaseRulesetSelectBox doesn't reference a null object
|
||||||
|
if (!withoutMods) modCheckboxes = getModCheckboxes()
|
||||||
|
|
||||||
add(Table().apply {
|
add(Table().apply {
|
||||||
defaults().pad(5f)
|
defaults().pad(5f)
|
||||||
addBaseRulesetSelectBox()
|
addBaseRulesetSelectBox()
|
||||||
@ -59,9 +62,7 @@ class GameOptionsTable(
|
|||||||
checkboxTable.addReligionCheckbox(cityStateSlider)
|
checkboxTable.addReligionCheckbox(cityStateSlider)
|
||||||
add(checkboxTable).center().row()
|
add(checkboxTable).center().row()
|
||||||
|
|
||||||
if (!withoutMods)
|
if (!withoutMods) add(modCheckboxes).row()
|
||||||
modCheckboxes = getModCheckboxes()
|
|
||||||
add(modCheckboxes).row()
|
|
||||||
|
|
||||||
pack()
|
pack()
|
||||||
}
|
}
|
||||||
@ -173,9 +174,6 @@ class GameOptionsTable(
|
|||||||
"This base ruleset is not compatible with the previously selected\nextension mods. They have been disabled.".tr()
|
"This base ruleset is not compatible with the previously selected\nextension mods. They have been disabled.".tr()
|
||||||
ToastPopup(toastMessage, previousScreen as CameraStageBaseScreen, 5000L)
|
ToastPopup(toastMessage, previousScreen as CameraStageBaseScreen, 5000L)
|
||||||
|
|
||||||
// _technically_, [modCheckBoxes] can be [null] at this point,
|
|
||||||
// but only if you change the option while the table is still loading,
|
|
||||||
// but the timeframe for that is so small I'm just going to ignore that
|
|
||||||
modCheckboxes!!.disableAllCheckboxes()
|
modCheckboxes!!.disableAllCheckboxes()
|
||||||
} else if (modLinkErrors.isWarnUser()) {
|
} else if (modLinkErrors.isWarnUser()) {
|
||||||
val toastMessage =
|
val toastMessage =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user