More PopupTable.close() uses

This commit is contained in:
Yair Morgenstern
2019-08-28 13:30:49 +03:00
parent e82b6c5090
commit ef75593794
4 changed files with 21 additions and 21 deletions

View File

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.app"
minSdkVersion 14
targetSdkVersion 28
versionCode 289
versionName "2.19.8"
versionCode 290
versionName "2.19.9"
}
// Had to add this crap for Travis to build, it wanted to sign the app

View File

@ -41,16 +41,16 @@ class CityScreenCityPickerTable(val cityScreen: CityScreen) : Table(){
val currentCityLabel = Label(city.name + " (" + city.population.population + ")", CameraStageBaseScreen.skin)
currentCityLabel.setFontSize(25)
currentCityLabel.onClick {
val popup = PopupTable(cityScreen)
val editCityNamePopup = PopupTable(cityScreen)
val textArea = TextField(city.name, CameraStageBaseScreen.skin)
textArea.setAlignment(Align.center)
popup.add(textArea).colspan(2).row()
popup.addButton("Close".tr()){popup.remove()}
popup.addButton("Save".tr()){
editCityNamePopup.add(textArea).colspan(2).row()
editCityNamePopup.addButton("Close".tr()){editCityNamePopup.close()}
editCityNamePopup.addButton("Save".tr()){
city.name = textArea.text
cityScreen.game.screen = CityScreen(city)
}
popup.open()
editCityNamePopup.open()
}
cityNameTable.add(currentCityLabel)

View File

@ -40,12 +40,12 @@ class LoadGameScreen : PickerScreen() {
UnCivGame.Current.loadGame(selectedSave)
}
catch (ex:Exception){
val popup = PopupTable(this)
popup.addGoodSizedLabel("It looks like your saved game can't be loaded!").row()
popup.addGoodSizedLabel("If you could copy your game data (\"Copy saved game to clipboard\" - ").row()
popup.addGoodSizedLabel(" paste into an email to yairm210@hotmail.com)").row()
popup.addGoodSizedLabel("I could maybe help you figure out what went wrong, since this isn't supposed to happen!").row()
popup.open()
val cantLoadGamePopup = PopupTable(this)
cantLoadGamePopup.addGoodSizedLabel("It looks like your saved game can't be loaded!").row()
cantLoadGamePopup.addGoodSizedLabel("If you could copy your game data (\"Copy saved game to clipboard\" - ").row()
cantLoadGamePopup.addGoodSizedLabel(" paste into an email to yairm210@hotmail.com)").row()
cantLoadGamePopup.addGoodSizedLabel("I could maybe help you figure out what went wrong, since this isn't supposed to happen!").row()
cantLoadGamePopup.open()
ex.printStackTrace()
}
}

View File

@ -171,14 +171,14 @@ class BattleTable(val worldScreen: WorldScreen): Table() {
worldScreen.shouldUpdate = true
}
catch (ex:Exception){
val popup = PopupTable(worldScreen)
popup.addGoodSizedLabel("You've encountered a bug that I've been looking for for a while!").row()
popup.addGoodSizedLabel("If you could copy your game data (\"Copy saved game to clipboard\" - ").row()
popup.addGoodSizedLabel(" paste into an email to yairm210@hotmail.com)").row()
popup.addGoodSizedLabel("It would help me figure out what went wrong, since this isn't supposed to happen!").row()
popup.addGoodSizedLabel("If you could tell me which unit was selected and which unit you tried to attack,").row()
popup.addGoodSizedLabel(" that would be even better!").row()
popup.open()
val battleBugPopup = PopupTable(worldScreen)
battleBugPopup.addGoodSizedLabel("You've encountered a bug that I've been looking for for a while!").row()
battleBugPopup.addGoodSizedLabel("If you could copy your game data (\"Copy saved game to clipboard\" - ").row()
battleBugPopup.addGoodSizedLabel(" paste into an email to yairm210@hotmail.com)").row()
battleBugPopup.addGoodSizedLabel("It would help me figure out what went wrong, since this isn't supposed to happen!").row()
battleBugPopup.addGoodSizedLabel("If you could tell me which unit was selected and which unit you tried to attack,").row()
battleBugPopup.addGoodSizedLabel(" that would be even better!").row()
battleBugPopup.open()
}
}
}