This commit is contained in:
parent
11f9728c94
commit
b4f3dadefa
1 changed files with 14 additions and 1 deletions
|
@ -39,7 +39,20 @@ class CityScreenCityPickerTable(val cityScreen: CityScreen) : Table(){
|
|||
}
|
||||
|
||||
val currentCityLabel = Label(city.name + " (" + city.population.population + ")", CameraStageBaseScreen.skin)
|
||||
currentCityLabel.setFontSize(30)
|
||||
currentCityLabel.setFontSize(25)
|
||||
currentCityLabel.onClick {
|
||||
val editCityNamePopup = PopupTable(cityScreen)
|
||||
val textArea = TextField(city.name, CameraStageBaseScreen.skin)
|
||||
textArea.setAlignment(Align.center)
|
||||
editCityNamePopup.add(textArea).colspan(2).row()
|
||||
editCityNamePopup.addCloseButton()
|
||||
editCityNamePopup.addButton("Save".tr()){
|
||||
city.name = textArea.text
|
||||
cityScreen.game.screen = CityScreen(city)
|
||||
}
|
||||
editCityNamePopup.open()
|
||||
}
|
||||
|
||||
cityNameTable.add(currentCityLabel)
|
||||
|
||||
add(cityNameTable)
|
||||
|
|
Loading…
Reference in a new issue