From e1819eb74885127fcf45d1de3c69b6223227f9d1 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sat, 26 Sep 2020 21:24:54 +0300 Subject: [PATCH] Scenarios that can't be loaded not displayed to users --- core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt b/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt index a3c45b9e2e..7cceebdfc4 100644 --- a/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt @@ -79,7 +79,10 @@ class MapOptionsTable(val newGameScreen: NewGameScreen): Table() { val scenarioSelectBox = SelectBox(CameraStageBaseScreen.skin) if (scenarioFiles.any()) { for (savedGame in getScenarioFiles()) { - scenarioSelectBox.items.add(FileHandleWrapper(savedGame)) + try { // Sometimes, we have scenarios that are dependent on mods that we don't have and so they can't be loaded. + selectSavedGameAsScenario(savedGame) + scenarioSelectBox.items.add(FileHandleWrapper(savedGame)) + } catch (ex: Exception) {} } scenarioSelectBox.items = scenarioSelectBox.items // it doesn't register them until you do this. scenarioSelectBox.selected = scenarioSelectBox.items.first()