This commit is contained in:
YueR 2019-09-15 20:41:28 +08:00
parent 11f9728c94
commit b4f3dadefa

View file

@ -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)