mirror of
https://github.com/yairm210/Unciv.git
synced 2025-10-04 17:58:32 -04:00
fixed crash (#3077)
This commit is contained in:
parent
6d190d1097
commit
0335b3ba46
@ -146,8 +146,10 @@ class MapOptionsTable(val newGameScreen: NewGameScreen): Table() {
|
|||||||
mapFileSelectBox.items = mapFiles
|
mapFileSelectBox.items = mapFiles
|
||||||
val selectedItem = mapFiles.firstOrNull { it.fileHandle.name()==mapParameters.name }
|
val selectedItem = mapFiles.firstOrNull { it.fileHandle.name()==mapParameters.name }
|
||||||
if (selectedItem != null) mapFileSelectBox.selected = selectedItem
|
if (selectedItem != null) mapFileSelectBox.selected = selectedItem
|
||||||
else mapFileSelectBox.selected = mapFiles.first()
|
else if (!mapFiles.isEmpty) {
|
||||||
|
mapFileSelectBox.selected = mapFiles.first()
|
||||||
newGameScreen.gameSetupInfo.mapFile = mapFileSelectBox.selected.fileHandle
|
newGameScreen.gameSetupInfo.mapFile = mapFileSelectBox.selected.fileHandle
|
||||||
|
}
|
||||||
|
|
||||||
mapFileSelectBox.onChange {
|
mapFileSelectBox.onChange {
|
||||||
val mapFile = mapFileSelectBox.selected.fileHandle
|
val mapFile = mapFileSelectBox.selected.fileHandle
|
||||||
|
Loading…
x
Reference in New Issue
Block a user