All text is now Roboto and much sharper!

Added lots of "Translatable" words
Organized City Screen a little bit
This commit is contained in:
Yair Morgenstern 2018-06-12 21:28:17 +03:00
parent 0c71c39bc2
commit 9e3772a58d
11 changed files with 64 additions and 56 deletions

View File

@ -7,6 +7,7 @@ import com.unciv.UnCivGame
import com.unciv.models.gamebasics.GameBasics import com.unciv.models.gamebasics.GameBasics
import com.unciv.ui.pickerscreens.PickerScreen import com.unciv.ui.pickerscreens.PickerScreen
import com.unciv.ui.utils.addClickListener import com.unciv.ui.utils.addClickListener
import com.unciv.ui.utils.tr
class VictoryScreen : PickerScreen() { class VictoryScreen : PickerScreen() {
@ -46,7 +47,7 @@ class VictoryScreen : PickerScreen() {
} }
fun won(){ fun won(){
rightSideButton.setText("Start new game") rightSideButton.setText("Start new game".tr())
rightSideButton.isVisible=true rightSideButton.isVisible=true
closeButton.isVisible=false closeButton.isVisible=false
rightSideButton.addClickListener { UnCivGame.Current.startNewGame(true) } rightSideButton.addClickListener { UnCivGame.Current.startNewGame(true) }

View File

@ -10,10 +10,7 @@ import com.unciv.logic.HexMath
import com.unciv.logic.city.CityInfo import com.unciv.logic.city.CityInfo
import com.unciv.logic.map.TileInfo import com.unciv.logic.map.TileInfo
import com.unciv.models.stats.Stats import com.unciv.models.stats.Stats
import com.unciv.ui.utils.CameraStageBaseScreen import com.unciv.ui.utils.*
import com.unciv.ui.utils.ImageGetter
import com.unciv.ui.utils.addClickListener
import com.unciv.ui.utils.centerX
import java.util.* import java.util.*
class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() { class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
@ -24,12 +21,10 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
private var cityStatsTable = CityStatsTable(this) private var cityStatsTable = CityStatsTable(this)
private var statExplainer = Table(skin) private var statExplainer = Table(skin)
private var cityPickerTable = Table() private var cityPickerTable = Table()
private var goToWorldButton = TextButton("Exit city", CameraStageBaseScreen.skin) private var goToWorldButton = TextButton("Exit city".tr(), CameraStageBaseScreen.skin)
private var tileGroups = ArrayList<CityTileGroup>() private var tileGroups = ArrayList<CityTileGroup>()
init { init {
Label("", CameraStageBaseScreen.skin).style.font.data.setScale(1.5f)
addTiles() addTiles()
stage.addActor(tileTable) stage.addActor(tileTable)
@ -119,7 +114,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
private fun updateCityPickerTable() { private fun updateCityPickerTable() {
cityPickerTable.clear() cityPickerTable.clear()
cityPickerTable.row().pad(20f) cityPickerTable.row()
val civInfo = city.civInfo val civInfo = city.civInfo
if (civInfo.cities.size > 1) { if (civInfo.cities.size > 1) {
@ -130,13 +125,19 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
game.screen = CityScreen(civInfo.cities[indexOfNextCity]) game.screen = CityScreen(civInfo.cities[indexOfNextCity])
dispose() dispose()
} }
cityPickerTable.add(prevCityButton) cityPickerTable.add(prevCityButton).pad(20f)
}
if(city.isCapital()){
val starImage = Image(ImageGetter.getDrawable("OtherIcons/Star.png").tint(Color.LIGHT_GRAY))
cityPickerTable.add(starImage).size(20f).padRight(5f)
} }
val currentCityLabel = Label(city.name+" ("+city.population.population+")", CameraStageBaseScreen.skin) val currentCityLabel = Label(city.name+" ("+city.population.population+")", CameraStageBaseScreen.skin)
currentCityLabel.setFontScale(2f) currentCityLabel.setFont(25)
cityPickerTable.add(currentCityLabel) cityPickerTable.add(currentCityLabel)
if (civInfo.cities.size > 1) { if (civInfo.cities.size > 1) {
val nextCityButton = TextButton(">", CameraStageBaseScreen.skin) val nextCityButton = TextButton(">", CameraStageBaseScreen.skin)
nextCityButton.addClickListener { nextCityButton.addClickListener {
@ -145,20 +146,19 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
game.screen = CityScreen(civInfo.cities[indexOfNextCity]) game.screen = CityScreen(civInfo.cities[indexOfNextCity])
dispose() dispose()
} }
cityPickerTable.add(nextCityButton) cityPickerTable.add(nextCityButton).pad(20f)
} }
cityPickerTable.row() cityPickerTable.row()
if (civInfo.cities.size > 1) cityPickerTable.add()
if(!city.isBeingRazed) { if(!city.isBeingRazed) {
val razeCityButton = TextButton("Raze city", skin) val razeCityButton = TextButton("Raze city".tr(), skin)
razeCityButton.addClickListener { city.isBeingRazed=true; update() } razeCityButton.addClickListener { city.isBeingRazed=true; update() }
cityPickerTable.add(razeCityButton) cityPickerTable.add(razeCityButton).colspan(cityPickerTable.columns)
} }
else{ else{
val stopRazingCityButton = TextButton("Stop razing city", skin) val stopRazingCityButton = TextButton("Stop razing city".tr(), skin)
stopRazingCityButton.addClickListener { city.isBeingRazed=false; update() } stopRazingCityButton.addClickListener { city.isBeingRazed=false; update() }
cityPickerTable.add(stopRazingCityButton) cityPickerTable.add(stopRazingCityButton).colspan(cityPickerTable.columns)
} }
cityPickerTable.pack() cityPickerTable.pack()
@ -174,8 +174,9 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
dispose() dispose()
} }
goToWorldButton.pad(5f)
goToWorldButton.setSize(goToWorldButton.prefWidth, goToWorldButton.prefHeight) goToWorldButton.setSize(goToWorldButton.prefWidth, goToWorldButton.prefHeight)
goToWorldButton.setPosition(10f, stage.height - goToWorldButton.height - 5f) goToWorldButton.setPosition(20f, stage.height - goToWorldButton.height - 20)
} }
private fun addTiles() { private fun addTiles() {
@ -248,7 +249,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
tileTable.columnDefaults(0).padRight(10f) tileTable.columnDefaults(0).padRight(10f)
val cityStatsHeader = Label("Tile Stats", CameraStageBaseScreen.skin) val cityStatsHeader = Label("Tile Stats", CameraStageBaseScreen.skin)
cityStatsHeader.setFontScale(2f) cityStatsHeader.setFont(25)
tileTable.add(cityStatsHeader).colspan(2).pad(10f) tileTable.add(cityStatsHeader).colspan(2).pad(10f)
tileTable.row() tileTable.row()

View File

@ -8,10 +8,7 @@ import com.unciv.UnCivGame
import com.unciv.logic.city.SpecialConstruction import com.unciv.logic.city.SpecialConstruction
import com.unciv.models.gamebasics.Building import com.unciv.models.gamebasics.Building
import com.unciv.ui.pickerscreens.ConstructionPickerScreen import com.unciv.ui.pickerscreens.ConstructionPickerScreen
import com.unciv.ui.utils.CameraStageBaseScreen import com.unciv.ui.utils.*
import com.unciv.ui.utils.ImageGetter
import com.unciv.ui.utils.addClickListener
import com.unciv.ui.utils.disable
import java.util.* import java.util.*
class CityStatsTable(val cityScreen: CityScreen) : Table(){ class CityStatsTable(val cityScreen: CityScreen) : Table(){
@ -25,7 +22,7 @@ class CityStatsTable(val cityScreen: CityScreen) : Table(){
val cityStatsHeader = Label("City Stats", CameraStageBaseScreen.skin) val cityStatsHeader = Label("City Stats", CameraStageBaseScreen.skin)
cityStatsHeader.setFontScale(2f) cityStatsHeader.setFont(15)
add(cityStatsHeader).colspan(2).pad(10f) add(cityStatsHeader).colspan(2).pad(10f)
row() row()
@ -64,7 +61,7 @@ class CityStatsTable(val cityScreen: CityScreen) : Table(){
!(construction is Building && construction.isWonder)) { !(construction is Building && construction.isWonder)) {
row() row()
val buildingGoldCost = construction.getGoldCost(city.civInfo.policies.getAdoptedPolicies()) val buildingGoldCost = construction.getGoldCost(city.civInfo.policies.getAdoptedPolicies())
val buildingBuyButton = TextButton("Buy for \r\n$buildingGoldCost gold", CameraStageBaseScreen.skin) val buildingBuyButton = TextButton("Buy for".tr()+"\r\n$buildingGoldCost gold", CameraStageBaseScreen.skin)
buildingBuyButton.addClickListener { buildingBuyButton.addClickListener {
city.cityConstructions.purchaseBuilding(city.cityConstructions.currentConstruction) city.cityConstructions.purchaseBuilding(city.cityConstructions.currentConstruction)
update() update()

View File

@ -10,6 +10,7 @@ import com.unciv.models.gamebasics.tile.TileImprovement
import com.unciv.ui.utils.ImageGetter import com.unciv.ui.utils.ImageGetter
import com.unciv.ui.utils.addClickListener import com.unciv.ui.utils.addClickListener
import com.unciv.ui.utils.setFontColor import com.unciv.ui.utils.setFontColor
import com.unciv.ui.utils.tr
class ImprovementPickerScreen(tileInfo: TileInfo) : PickerScreen() { class ImprovementPickerScreen(tileInfo: TileInfo) : PickerScreen() {
private var selectedImprovement: TileImprovement? = null private var selectedImprovement: TileImprovement? = null
@ -35,7 +36,7 @@ class ImprovementPickerScreen(tileInfo: TileInfo) : PickerScreen() {
improvementButton.add(ImageGetter.getImage("OtherIcons/Stop.png")).size(30f).pad(10f) improvementButton.add(ImageGetter.getImage("OtherIcons/Stop.png")).size(30f).pad(10f)
else improvementButton.add(ImageGetter.getImprovementIcon(improvement.name)).size(30f).pad(10f) else improvementButton.add(ImageGetter.getImprovementIcon(improvement.name)).size(30f).pad(10f)
improvementButton.add(Label(improvement.name + " - " + improvement.getTurnsToBuild(civInfo) + " turns",skin) improvementButton.add(Label(improvement.name + " - " + improvement.getTurnsToBuild(civInfo) + " "+"turns".tr(),skin)
.setFontColor(Color.WHITE)).pad(10f) .setFontColor(Color.WHITE)).pad(10f)
improvementButton.addClickListener { improvementButton.addClickListener {

View File

@ -91,6 +91,9 @@ open class CameraStageBaseScreen : Screen {
companion object { companion object {
var skin = Skin(Gdx.files.internal("skin/flat-earth-ui.json")) var skin = Skin(Gdx.files.internal("skin/flat-earth-ui.json"))
.apply {
get<TextButton.TextButtonStyle>(TextButton.TextButtonStyle::class.java).font = getFont(20)
get<Label.LabelStyle>(Label.LabelStyle::class.java).font = getFont(18) }
internal var batch: Batch = SpriteBatch() internal var batch: Batch = SpriteBatch()
} }
@ -124,22 +127,30 @@ fun Label.setFontColor(color:Color): Label {style=Label.LabelStyle(style).apply
fun String.tr(): String {return GameBasics.Translations.get(this,UnCivGame.Current.settings.language)} fun String.tr(): String {return GameBasics.Translations.get(this,UnCivGame.Current.settings.language)}
fun getFont(size: Int): BitmapFont { fun getFont(size: Int): BitmapFont {
// var screenScale = Gdx.graphics.width / 1000f // screen virtual width as defined in CameraStageBaseScreen
// if(screenScale<1) screenScale=1f
val generator = FreeTypeFontGenerator(Gdx.files.internal("skin/Roboto-Regular.ttf")) val generator = FreeTypeFontGenerator(Gdx.files.internal("skin/Roboto-Regular.ttf"))
val parameter = FreeTypeFontGenerator.FreeTypeFontParameter() val parameter = FreeTypeFontGenerator.FreeTypeFontParameter()
parameter.size = size parameter.size = size
parameter.genMipMaps = true // parameter.genMipMaps = true
parameter.minFilter = Texture.TextureFilter.MipMapLinearLinear parameter.minFilter = Texture.TextureFilter.Linear
parameter.magFilter = Texture.TextureFilter.MipMapLinearLinear parameter.magFilter = Texture.TextureFilter.Linear
parameter.characters = "ABCČĆDĐEFGHIJKLMNOPQRSŠTUVWXYZŽabcčćdđefghijklmnopqrsštuvwxyzžАБВГҐДЂЕЁЄЖЗЅИІЇЙЈКЛЉМНЊОПРСТЋУЎФХЦЧЏШЩЪЫЬЭЮЯабвгґдђеёєжзѕиіїйјклљмнњопрстћуўфхцчџшщъыьэюяΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρστυφχψωάΆέΈέΉίϊΐΊόΌύΰϋΎΫΏĂÂÊÔƠƯăâêôơư1234567890?’“!”(%)[#]{@}/&\\<-+÷×=>®©\$€£¥¢:;,.*|" parameter.characters = "ABCČĆDĐEFGHIJKLMNOPQRSŠTUVWXYZŽabcčćdđefghijklmnopqrsštuvwxyzžАБВГҐДЂЕЁЄЖЗЅИІЇЙЈКЛЉМНЊОПРСТЋУЎФХЦЧЏШЩЪЫЬЭЮЯабвгґдђеёєжзѕиіїйјклљмнњопрстћуўфхцчџшщъыьэюяΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρστυφχψωάΆέΈέΉίϊΐΊόΌύΰϋΎΫΏĂÂÊÔƠƯăâêôơư1234567890?’“!”(%)[#]{@}/&\\<-+÷×=>®©\$€£¥¢:;,.*|"
//generator.scaleForPixelHeight(size)
val font = generator.generateFont(parameter) // font size 12 pixels val font = generator.generateFont(parameter) // font size 12 pixels
// font.data.setScale(1f/screenScale)
generator.dispose() // don't forget to dispose to avoid memory leaks! generator.dispose() // don't forget to dispose to avoid memory leaks!
return font return font
} }
fun Label.setFont(size:Int) { fun Label.setFont(size:Int): Label {
style = Label.LabelStyle(style) style = Label.LabelStyle(style)
style.font = getFont(size) style.font = getFont(size)
style = style // because we need it to call the SetStyle function. Yuk, I know. style = style // because we need it to call the SetStyle function. Yuk, I know.
return this // for chaining
} }
fun Actor.addClickListener(function: () -> Unit) { fun Actor.addClickListener(function: () -> Unit) {

View File

@ -5,10 +5,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Label
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane
import com.badlogic.gdx.scenes.scene2d.ui.Table import com.badlogic.gdx.scenes.scene2d.ui.Table
import com.unciv.logic.civilization.Notification import com.unciv.logic.civilization.Notification
import com.unciv.ui.utils.CameraStageBaseScreen import com.unciv.ui.utils.*
import com.unciv.ui.utils.ImageGetter
import com.unciv.ui.utils.addClickListener
import com.unciv.ui.utils.setFontColor
import kotlin.math.min import kotlin.math.min
class NotificationsScroll(private val notifications: List<Notification>, internal val worldScreen: WorldScreen) : ScrollPane(null) { class NotificationsScroll(private val notifications: List<Notification>, internal val worldScreen: WorldScreen) : ScrollPane(null) {
@ -22,8 +19,7 @@ class NotificationsScroll(private val notifications: List<Notification>, interna
notificationsTable.clearChildren() notificationsTable.clearChildren()
for (notification in notifications) { for (notification in notifications) {
val label = Label(notification.text, CameraStageBaseScreen.skin).setFontColor(Color.BLACK) val label = Label(notification.text, CameraStageBaseScreen.skin).setFontColor(Color.BLACK)
label.setFontScale(1.2f) .setFont(14)
val minitable = Table() val minitable = Table()
minitable.add(ImageGetter.getImage("OtherIcons/Circle.png") minitable.add(ImageGetter.getImage("OtherIcons/Circle.png")

View File

@ -2,17 +2,13 @@ package com.unciv.ui.worldscreen
import com.badlogic.gdx.Gdx import com.badlogic.gdx.Gdx
import com.badlogic.gdx.math.Vector2 import com.badlogic.gdx.math.Vector2
import com.badlogic.gdx.scenes.scene2d.ui.Label
import com.badlogic.gdx.scenes.scene2d.ui.TextButton import com.badlogic.gdx.scenes.scene2d.ui.TextButton
import com.unciv.logic.GameSaver import com.unciv.logic.GameSaver
import com.unciv.logic.civilization.CivilizationInfo import com.unciv.logic.civilization.CivilizationInfo
import com.unciv.ui.pickerscreens.GreatPersonPickerScreen import com.unciv.ui.pickerscreens.GreatPersonPickerScreen
import com.unciv.ui.pickerscreens.PolicyPickerScreen import com.unciv.ui.pickerscreens.PolicyPickerScreen
import com.unciv.ui.pickerscreens.TechPickerScreen import com.unciv.ui.pickerscreens.TechPickerScreen
import com.unciv.ui.utils.CameraStageBaseScreen import com.unciv.ui.utils.*
import com.unciv.ui.utils.addClickListener
import com.unciv.ui.utils.disable
import com.unciv.ui.utils.enable
import com.unciv.ui.worldscreen.bottombar.WorldScreenBottomBar import com.unciv.ui.worldscreen.bottombar.WorldScreenBottomBar
import com.unciv.ui.worldscreen.unit.UnitActionsTable import com.unciv.ui.worldscreen.unit.UnitActionsTable
@ -41,7 +37,6 @@ class WorldScreen : CameraStageBaseScreen() {
topBar.y - nextTurnButton.height - 10f) topBar.y - nextTurnButton.height - 10f)
notificationsScroll = NotificationsScroll(gameInfo.notifications, this) notificationsScroll = NotificationsScroll(gameInfo.notifications, this)
notificationsScroll.width = stage.width/3 notificationsScroll.width = stage.width/3
Label("", skin).style.font.data.setScale(1.5f)
minimap.setSize(stage.width/5,stage.height/5) minimap.setSize(stage.width/5,stage.height/5)
minimap.x = stage.width - minimap.width minimap.x = stage.width - minimap.width
@ -108,7 +103,7 @@ class WorldScreen : CameraStageBaseScreen() {
} }
private fun createNextTurnButton(): TextButton { private fun createNextTurnButton(): TextButton {
val nextTurnButton = TextButton("Next turn", CameraStageBaseScreen.skin) val nextTurnButton = TextButton("Next turn".tr(), CameraStageBaseScreen.skin)
nextTurnButton.addClickListener { nextTurnButton.addClickListener {
if (civInfo.tech.freeTechs != 0) { if (civInfo.tech.freeTechs != 0) {
game.screen = TechPickerScreen(true, civInfo) game.screen = TechPickerScreen(true, civInfo)
@ -134,7 +129,7 @@ class WorldScreen : CameraStageBaseScreen() {
shouldUpdate=true shouldUpdate=true
GameSaver().saveGame(game.gameInfo, "Autosave") GameSaver().saveGame(game.gameInfo, "Autosave")
nextTurnButton.setText("Next turn") nextTurnButton.setText("Next turn".tr())
nextTurnButton.enable() nextTurnButton.enable()
Gdx.input.inputProcessor = stage Gdx.input.inputProcessor = stage
} }

View File

@ -98,7 +98,8 @@ class BattleTable(val worldScreen: WorldScreen): Table() {
else if (damageToDefender>defender.getHealth()) damageToDefender=defender.getHealth() else if (damageToDefender>defender.getHealth()) damageToDefender=defender.getHealth()
if(attacker.isMelee() && (defender.getUnitType()==UnitType.Civilian || defender.getUnitType()==UnitType.City && defender.isDefeated())) { if(attacker.isMelee() && (defender.getUnitType()==UnitType.Civilian
|| defender.getUnitType()==UnitType.City && defender.isDefeated())) {
add("") add("")
add("Captured!") add("Captured!")
} }

View File

@ -8,6 +8,7 @@ import com.unciv.logic.GameSaver
import com.unciv.models.gamebasics.GameBasics import com.unciv.models.gamebasics.GameBasics
import com.unciv.ui.utils.CameraStageBaseScreen import com.unciv.ui.utils.CameraStageBaseScreen
import com.unciv.ui.utils.center import com.unciv.ui.utils.center
import com.unciv.ui.worldscreen.WorldScreen
class WorldScreenDisplayOptionsTable() : OptionsTable(){ class WorldScreenDisplayOptionsTable() : OptionsTable(){
init { init {
@ -35,6 +36,8 @@ class WorldScreenDisplayOptionsTable() : OptionsTable(){
override fun changed(event: ChangeEvent?, actor: Actor?) { override fun changed(event: ChangeEvent?, actor: Actor?) {
UnCivGame.Current.settings.language = languageSelectBox.selected; UnCivGame.Current.settings.language = languageSelectBox.selected;
GameSaver().setGeneralSettings(UnCivGame.Current.settings) GameSaver().setGeneralSettings(UnCivGame.Current.settings)
UnCivGame.Current.worldScreen = WorldScreen()
UnCivGame.Current.setWorldScreen()
} }
}) })

View File

@ -4,40 +4,41 @@ import com.unciv.UnCivGame
import com.unciv.ui.* import com.unciv.ui.*
import com.unciv.ui.pickerscreens.PolicyPickerScreen import com.unciv.ui.pickerscreens.PolicyPickerScreen
import com.unciv.ui.utils.center import com.unciv.ui.utils.center
import com.unciv.ui.utils.tr
class WorldScreenOptionsTable internal constructor() : OptionsTable() { class WorldScreenOptionsTable internal constructor() : OptionsTable() {
init { init {
addButton("Civilopedia"){ addButton("Civilopedia".tr()){
UnCivGame.Current.screen = CivilopediaScreen() UnCivGame.Current.screen = CivilopediaScreen()
remove() remove()
} }
addButton("Load game"){ addButton("Load game".tr()){
UnCivGame.Current.screen = LoadScreen() UnCivGame.Current.screen = LoadScreen()
remove() remove()
} }
addButton("Save game") { addButton("Save game".tr()) {
UnCivGame.Current.screen = SaveScreen() UnCivGame.Current.screen = SaveScreen()
remove() remove()
} }
addButton("Start new game"){ UnCivGame.Current.screen = NewGameScreen() } addButton("Start new game".tr()){ UnCivGame.Current.screen = NewGameScreen() }
addButton("Victory status") { UnCivGame.Current.screen = VictoryScreen() } addButton("Victory status".tr()) { UnCivGame.Current.screen = VictoryScreen() }
addButton("Social Policies"){ addButton("Social Policies".tr()){
UnCivGame.Current.screen = PolicyPickerScreen(UnCivGame.Current.gameInfo.getPlayerCivilization()) UnCivGame.Current.screen = PolicyPickerScreen(UnCivGame.Current.gameInfo.getPlayerCivilization())
} }
addButton("Display options"){ addButton("Display options".tr()){
UnCivGame.Current.worldScreen.stage.addActor(WorldScreenDisplayOptionsTable()) UnCivGame.Current.worldScreen.stage.addActor(WorldScreenDisplayOptionsTable())
remove() remove()
} }
addButton("Close"){ remove() } addButton("Close".tr()){ remove() }
pack() // Needed to show the background. pack() // Needed to show the background.
center(UnCivGame.Current.worldScreen.stage) center(UnCivGame.Current.worldScreen.stage)

View File

@ -7,6 +7,7 @@ import com.unciv.logic.map.TileInfo
import com.unciv.models.gamebasics.unit.UnitType import com.unciv.models.gamebasics.unit.UnitType
import com.unciv.ui.utils.CameraStageBaseScreen import com.unciv.ui.utils.CameraStageBaseScreen
import com.unciv.ui.utils.addClickListener import com.unciv.ui.utils.addClickListener
import com.unciv.ui.utils.tr
import com.unciv.ui.worldscreen.WorldScreen import com.unciv.ui.worldscreen.WorldScreen
class UnitTable(val worldScreen: WorldScreen) : Table(){ class UnitTable(val worldScreen: WorldScreen) : Table(){
@ -50,12 +51,12 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
if(unit.health<100) nameLabelText+=" ("+unit.health+")" if(unit.health<100) nameLabelText+=" ("+unit.health+")"
unitNameLabel.setText(nameLabelText) unitNameLabel.setText(nameLabelText)
var unitLabelText = "Movement: " + unit.getMovementString() var unitLabelText = "Movement".tr()+": " + unit.getMovementString()
if (unit.getBaseUnit().unitType != UnitType.Civilian) { if (unit.getBaseUnit().unitType != UnitType.Civilian) {
unitLabelText += "\nStrength: " + unit.getBaseUnit().strength unitLabelText += "\n"+"Strength".tr()+": " + unit.getBaseUnit().strength
} }
if (unit.getBaseUnit().rangedStrength!=0) if (unit.getBaseUnit().rangedStrength!=0)
unitLabelText += "\nRanged strength: "+unit.getBaseUnit().rangedStrength unitLabelText += "\n"+"Ranged strength".tr()+": "+unit.getBaseUnit().rangedStrength
if(unit.isFortified() && unit.getFortificationTurns()>0) if(unit.isFortified() && unit.getFortificationTurns()>0)
unitLabelText+="\n+"+unit.getFortificationTurns()*20+"% fortification" unitLabelText+="\n+"+unit.getFortificationTurns()*20+"% fortification"