mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-10 04:43:29 +07:00
Game no longer crashes on new game screen when no scenarios are available
This commit is contained in:
parent
324f4d7a15
commit
be216d8e6b
@ -80,7 +80,9 @@ class MapOptionsTable(val newGameScreen: NewGameScreen): Table() {
|
||||
override fun toString() = fileHandle.name()
|
||||
}
|
||||
|
||||
val scenarioFiles = getScenarioFiles()
|
||||
val scenarioSelectBox = SelectBox<FileHandleWrapper>(CameraStageBaseScreen.skin)
|
||||
if (scenarioFiles.any()) {
|
||||
for (savedGame in getScenarioFiles()) {
|
||||
scenarioSelectBox.items.add(FileHandleWrapper(savedGame))
|
||||
}
|
||||
@ -90,6 +92,7 @@ class MapOptionsTable(val newGameScreen: NewGameScreen): Table() {
|
||||
scenarioSelectBox.onChange { selectSavedGameAsScenario(scenarioSelectBox.selected.fileHandle) }
|
||||
scenarioOptionsTable.add("{Scenario file}:".toLabel()).left()
|
||||
scenarioOptionsTable.add(scenarioSelectBox)
|
||||
}
|
||||
|
||||
fun updateOnMapTypeChange() {
|
||||
mapTypeSpecificTable.clear()
|
||||
|
Loading…
Reference in New Issue
Block a user