mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 06:16:37 -04:00
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:
parent
440941cdea
commit
9f3a943865
@ -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
|
||||||
|
@ -98,24 +98,31 @@ class NewGameScreenOptionsTable(val newGameParameters: GameParameters, val rules
|
|||||||
val worldSizeSelectBox = getWorldSizeSelectBox()
|
val worldSizeSelectBox = getWorldSizeSelectBox()
|
||||||
val worldSizeLabel = "{World size}:".toLabel()
|
val worldSizeLabel = "{World size}:".toLabel()
|
||||||
|
|
||||||
|
fun updateOnMapTypeChange(){
|
||||||
|
newGameParameters.mapType = mapTypeSelectBox.selected.value
|
||||||
|
if (newGameParameters.mapType == MapType.file) {
|
||||||
|
worldSizeSelectBox.isVisible = false
|
||||||
|
worldSizeLabel.isVisible = false
|
||||||
|
mapFileSelectBox.isVisible = true
|
||||||
|
mapFileLabel.isVisible = true
|
||||||
|
newGameParameters.mapFileName = mapFileSelectBox.selected
|
||||||
|
} else {
|
||||||
|
worldSizeSelectBox.isVisible = true
|
||||||
|
worldSizeLabel.isVisible = true
|
||||||
|
mapFileSelectBox.isVisible = false
|
||||||
|
mapFileLabel.isVisible = false
|
||||||
|
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() {
|
mapTypeSelectBox.addListener(object : ChangeListener() {
|
||||||
override fun changed(event: ChangeEvent?, actor: Actor?) {
|
override fun changed(event: ChangeEvent?, actor: Actor?) {
|
||||||
newGameParameters.mapType = mapTypeSelectBox.selected.value
|
updateOnMapTypeChange()
|
||||||
if (newGameParameters.mapType == MapType.file) {
|
|
||||||
worldSizeSelectBox.isVisible = false
|
|
||||||
worldSizeLabel.isVisible = false
|
|
||||||
mapFileSelectBox.isVisible = true
|
|
||||||
mapFileLabel.isVisible = true
|
|
||||||
newGameParameters.mapFileName = mapFileSelectBox.selected
|
|
||||||
} else {
|
|
||||||
worldSizeSelectBox.isVisible = true
|
|
||||||
worldSizeLabel.isVisible = true
|
|
||||||
mapFileSelectBox.isVisible = false
|
|
||||||
mapFileLabel.isVisible = false
|
|
||||||
newGameParameters.mapFileName = null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
add(mapTypeSelectBox).pad(10f).row()
|
add(mapTypeSelectBox).pad(10f).row()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user