Returned tile info table in the city screen, construction scroll now translated, added city screen translations to translations file - #417

This commit is contained in:
Yair Morgenstern 2019-01-22 21:48:30 +02:00
parent 2267d2945d
commit baed1e50cd
5 changed files with 35 additions and 19 deletions

View file

@ -738,7 +738,19 @@
Spanish:"Nada"
Simplified_Chinese:"无"
Portuguese:"Nada"
}
}
"Specialist Buildings":{}
"Specialist Allocation":{}
"Free population":{} // as in "Free population: 2/13
"[turnsToExpansion] turns to expansion":{}
"Stopped expansion":{} // if culture is 0
"[turnsToPopulation] turns to new population":{}
"[turnsToStarvation] turns to lose population":{}
"Stopped population growth":{}
"In resistance for another [numberOfTurns] turns":{}
// todo
// Tech picker
"Pick a tech":{
@ -4023,12 +4035,15 @@
Romanian:"Minuni"
Spanish:"Maravillas"
German:"Wunder"
}
}
"Specialist Buildings":{
Romanian:"Clădiri specializate"
Spanish:"Edificios Ocupables"
German:"Gebäude der Spezialisten"
}
}
"Other":{ // Used for "other constructions" - Gold, Science, Nothing
}
"Population":{
Italian:"Popolazione"
Russian:"Население"

View file

@ -24,13 +24,13 @@ class CityInfoTable(private val cityScreen: CityScreen) : Table(CameraStageBaseS
val cityInfo = cityScreen.city
val wonders = mutableListOf<Building>()
val specialistBuildings = mutableListOf<Building>()
val others = mutableListOf<Building>()
val otherBuildings = mutableListOf<Building>()
for (building in cityInfo.cityConstructions.getBuiltBuildings()) {
when {
building.isWonder -> wonders.add(building)
building.specialistSlots != null -> specialistBuildings.add(building)
else -> others.add(building)
else -> otherBuildings.add(building)
}
}
@ -62,9 +62,9 @@ class CityInfoTable(private val cityScreen: CityScreen) : Table(CameraStageBaseS
addSpecialistAllocation(skin, cityInfo)
}
if (!others.isEmpty()) {
if (!otherBuildings.isEmpty()) {
val buildingsExpanderTab = ExpanderTab("Buildings".tr(),skin)
for (building in others) {
for (building in otherBuildings) {
buildingsExpanderTab.innerTable.add(ImageGetter.getConstructionImage(building.name).surroundWithCircle(30f))
buildingsExpanderTab.innerTable.add(Label(building.name.tr(), skin)).pad(5f).row()
}
@ -110,7 +110,7 @@ class CityInfoTable(private val cityScreen: CityScreen) : Table(CameraStageBaseS
}
private fun addSpecialistAllocation(skin: Skin, cityInfo: CityInfo) {
val specialistAllocationExpander = ExpanderTab("Specialist allocation", skin)
val specialistAllocationExpander = ExpanderTab("Specialist Allocation".tr(), skin)
specialistAllocationExpander.innerTable.defaults().pad(5f)

View file

@ -31,11 +31,9 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
init {
onBackButtonClicked { UnCivGame.Current.setWorldScreen(); dispose() }
addTiles()
stage.addActor(tileTable)
val tableBackgroundColor = ImageGetter.getBlue().lerp(Color.BLACK,0.5f)
tileTable.background = ImageGetter.getBackground(tableBackgroundColor)
var buildingsTableContainer = Table()
buildingsTableContainer.pad(3f)
@ -94,7 +92,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
table.defaults().pad(5f)
table.background=ImageGetter.getBackground(Color.BLACK.cpy().apply { a=0.8f })
val columns = Stats().toHashMap().size
table.add(Label("Free population:"
table.add(Label("{Free population}:".tr()
+city.population.getFreePopulation().toString() + "/" + city.population.population,skin))
.colspan(columns).row()
@ -102,7 +100,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
if (city.cityStats.currentCityStats.culture > 0) {
val turnsToExpansion = ceil((city.expansion.getCultureToNextTile() - city.expansion.cultureStored)
/ city.cityStats.currentCityStats.culture).toInt()
turnsToExpansionString = turnsToExpansion.toString() + " turns to expansion"
turnsToExpansionString = "[$turnsToExpansion] turns to expansion".tr()
} else {
turnsToExpansionString = "Stopped expansion"
}
@ -113,18 +111,18 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
if (city.cityStats.currentCityStats.food > 0) {
val turnsToPopulation = ceil((city.population.getFoodToNextPopulation()-city.population.foodStored)
/ city.cityStats.currentCityStats.food).toInt()
turnsToPopString = turnsToPopulation.toString()+ " turns to new population"
turnsToPopString = "[$turnsToPopulation] turns to new population".tr()
} else if (city.cityStats.currentCityStats.food < 0) {
val turnsToStarvation = ceil(city.population.foodStored / -city.cityStats.currentCityStats.food).toInt()
turnsToPopString = turnsToStarvation.toString()+ " turns to lose population"
turnsToPopString = "[$turnsToStarvation] turns to lose population"
} else {
turnsToPopString = "Stopped population growth"
turnsToPopString = "Stopped population growth".tr()
}
table.add(Label(turnsToPopString + " (" + city.population.foodStored + "/" + city.population.getFoodToNextPopulation() + ")"
,skin)).colspan(columns).row()
if (city.resistanceCounter > 0) {
table.add(Label("In resistance for another ${city.resistanceCounter} turns",skin)).colspan(columns).row()
table.add(Label("In resistance for another [${city.resistanceCounter}] turns".tr(),skin)).colspan(columns).row()
}
table.addSeparator()
@ -293,6 +291,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
}
private fun updateTileTable() {
tileTable.remove()
if (selectedTile == null) return
val tile = selectedTile!!
tileTable.clearChildren()
@ -325,8 +324,10 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
tileTable.add(acquireTileButton)
}
tileTable.background = ImageGetter.getBackground(ImageGetter.getBlue().lerp(Color.BLACK,0.5f))
tileTable=tileTable.addBorder(2f, Color.WHITE)
tileTable.setPosition(stage.width - 5f - tileTable.width, 5f)
stage.addActor(tileTable)
}
companion object {

View file

@ -79,7 +79,7 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre
val units = ArrayList<Table>()
for (unit in GameBasics.Units.values.filter { it.isBuildable(cityConstructions) })
units += getProductionButton(unit.name,
unit.name + "\r\n" + cityConstructions.turnsToConstruction(unit.name) + " {turns}".tr())
unit.name.tr() + "\r\n" + cityConstructions.turnsToConstruction(unit.name) + " {turns}".tr())
constructionPickerTable.addCategory("Units",units)
@ -160,7 +160,7 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre
description = currentConstruction.getDescription(true)
else if (currentConstruction is Building)
description = currentConstruction.getDescription(true, city.civInfo.policies.adoptedPolicies)
else description = currentConstruction.description
else description = currentConstruction.description.tr()
val descriptionLabel = Label(description, CameraStageBaseScreen.skin)
descriptionLabel.setWrap(true)