Long translated leader names now display nicely in civ picker popup

This commit is contained in:
Yair Morgenstern 2019-12-08 12:59:38 +02:00
parent de50262da2
commit 297e604bbf
4 changed files with 14 additions and 8 deletions

View File

@ -2112,7 +2112,7 @@ Czech:"'Pro spásu duše jsou nezbytné tři věci: vědět čemu věřit; věd
French:"Ère du futur"
Romanian:"Era viitorului"
Dutch:"Toekomst"
Spanish:"Era do Futuro"
Spanish:"Era de Futuro"
Simplified_Chinese:"未来时代"
Traditional_Chinese:"未來時代"
Portuguese:"Era futurista" //Futurista means futuristic if you want it replaced just put futura (same as spanish) in its place.

View File

@ -18,7 +18,7 @@ buildscript {
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.1'
// This is for wrapping the .jar file into a standalone executable

View File

@ -3,8 +3,8 @@ package com.unciv.ui.newgamescreen
import com.badlogic.gdx.scenes.scene2d.Touchable
import com.badlogic.gdx.scenes.scene2d.ui.Label
import com.badlogic.gdx.scenes.scene2d.ui.Table
import com.unciv.models.gamebasics.Ruleset
import com.unciv.models.gamebasics.Nation
import com.unciv.models.gamebasics.Ruleset
import com.unciv.models.gamebasics.Translations
import com.unciv.models.gamebasics.tr
import com.unciv.ui.utils.CameraStageBaseScreen
@ -22,7 +22,13 @@ class NationTable(val nation: Nation, width:Float, ruleset: Ruleset)
val titleTable = Table()
titleTable.add(ImageGetter.getNationIndicator(nation, 50f)).pad(10f)
titleTable.add(nation.getLeaderDisplayName().toLabel(nation.getInnerColor(),24))
val leaderDisplayLabel = nation.getLeaderDisplayName().toLabel(nation.getInnerColor(),24)
val leaderDisplayNameMaxWidth = width - 70 // for the nation indicator
if(leaderDisplayLabel.width > leaderDisplayNameMaxWidth){
leaderDisplayLabel.setWrap(true)
titleTable.add(leaderDisplayLabel).width(leaderDisplayNameMaxWidth)
}
else titleTable.add(leaderDisplayLabel)
innerTable.add(titleTable).row()
innerTable.add(getUniqueLabel(nation,ruleset).apply { setWrap(true) }).width(width)

View File

@ -20,7 +20,7 @@ import java.util.*
class PlayerPickerTable(val newGameScreen: NewGameScreen, val newGameParameters: GameParameters): Table() {
val playerListTable = Table()
val halfWidth = newGameScreen.stage.width / 2.5f
val nationsPopupWidth = newGameScreen.stage.width / 2.5f
init {
add(ScrollPane(playerListTable)).width(newGameScreen.stage.width/2)
@ -134,18 +134,18 @@ class PlayerPickerTable(val newGameScreen: NewGameScreen, val newGameParameters:
nationsPopup.close()
update()
}
nationListTable.add(randomPlayerTable).pad(10f).width(halfWidth).row()
nationListTable.add(randomPlayerTable).pad(10f).width(nationsPopupWidth).row()
for (nation in newGameScreen.ruleSet.Nations.values.filter { !it.isCityState() && it.name != "Barbarians" }) {
if (player.chosenCiv != nation.name && newGameParameters.players.any { it.chosenCiv == nation.name })
continue
nationListTable.add(NationTable(nation, halfWidth,newGameScreen.ruleSet).onClick {
nationListTable.add(NationTable(nation, nationsPopupWidth,newGameScreen.ruleSet).onClick {
player.chosenCiv = nation.name
nationsPopup.close()
update()
}).pad(10f).width(halfWidth).row()
}).pad(10f).width(nationsPopupWidth).row()
}
nationsPopup.add(ScrollPane(nationListTable)).height(newGameScreen.stage.height * 0.8f)
nationsPopup.open()