Resolved #1426 - starting a new game from a file-map game shows new correct options on the new game screen

This commit is contained in:
Yair Morgenstern 2019-12-07 20:31:04 +02:00
parent 440941cdea
commit 9f3a943865
2 changed files with 23 additions and 16 deletions

View file

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.app" applicationId "com.unciv.app"
minSdkVersion 14 minSdkVersion 14
targetSdkVersion 29 targetSdkVersion 29
versionCode 336 versionCode 337
versionName "3.3.5" versionName "3.3.6"
} }
// Had to add this crap for Travis to build, it wanted to sign the app // Had to add this crap for Travis to build, it wanted to sign the app

View file

@ -98,8 +98,7 @@ class NewGameScreenOptionsTable(val newGameParameters: GameParameters, val rules
val worldSizeSelectBox = getWorldSizeSelectBox() val worldSizeSelectBox = getWorldSizeSelectBox()
val worldSizeLabel = "{World size}:".toLabel() val worldSizeLabel = "{World size}:".toLabel()
mapTypeSelectBox.addListener(object : ChangeListener() { fun updateOnMapTypeChange(){
override fun changed(event: ChangeEvent?, actor: Actor?) {
newGameParameters.mapType = mapTypeSelectBox.selected.value newGameParameters.mapType = mapTypeSelectBox.selected.value
if (newGameParameters.mapType == MapType.file) { if (newGameParameters.mapType == MapType.file) {
worldSizeSelectBox.isVisible = false worldSizeSelectBox.isVisible = false
@ -115,7 +114,15 @@ class NewGameScreenOptionsTable(val newGameParameters: GameParameters, val rules
newGameParameters.mapFileName = null newGameParameters.mapFileName = null
} }
} }
updateOnMapTypeChange() // activate once, so when we had a file map before we'll have the right things set for another one
mapTypeSelectBox.addListener(object : ChangeListener() {
override fun changed(event: ChangeEvent?, actor: Actor?) {
updateOnMapTypeChange()
}
}) })
add(mapTypeSelectBox).pad(10f).row() add(mapTypeSelectBox).pad(10f).row()