mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-20 12:48:56 +07:00
Better checking for unloadable scenarios
This commit is contained in:
@ -304,9 +304,9 @@ class MapUnit {
|
|||||||
updateUniques()
|
updateUniques()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun useMovementPoints(amount:Float){
|
fun useMovementPoints(amount:Float) {
|
||||||
currentMovement -= amount
|
currentMovement -= amount
|
||||||
if(currentMovement<0) currentMovement = 0f
|
if (currentMovement < 0) currentMovement = 0f
|
||||||
}
|
}
|
||||||
|
|
||||||
fun doAction() {
|
fun doAction() {
|
||||||
|
@ -80,10 +80,11 @@ class MapOptionsTable(val newGameScreen: NewGameScreen): Table() {
|
|||||||
if (scenarioFiles.any()) {
|
if (scenarioFiles.any()) {
|
||||||
for (savedGame in getScenarioFiles()) {
|
for (savedGame in getScenarioFiles()) {
|
||||||
try { // Sometimes, we have scenarios that are dependent on mods that we don't have and so they can't be loaded.
|
try { // Sometimes, we have scenarios that are dependent on mods that we don't have and so they can't be loaded.
|
||||||
selectSavedGameAsScenario(savedGame)
|
GameSaver.loadGameFromFile(savedGame)
|
||||||
scenarioSelectBox.items.add(FileHandleWrapper(savedGame))
|
scenarioSelectBox.items.add(FileHandleWrapper(savedGame))
|
||||||
} catch (ex: Exception) {}
|
} catch (ex: Exception) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
scenarioSelectBox.items = scenarioSelectBox.items // it doesn't register them until you do this.
|
scenarioSelectBox.items = scenarioSelectBox.items // it doesn't register them until you do this.
|
||||||
scenarioSelectBox.selected = scenarioSelectBox.items.first()
|
scenarioSelectBox.selected = scenarioSelectBox.items.first()
|
||||||
// needs to be after the item change, so it doesn't activate before we choose the Scenario maptype
|
// needs to be after the item change, so it doesn't activate before we choose the Scenario maptype
|
||||||
|
Reference in New Issue
Block a user