diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index 0dfcb019..65a36bed 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -34,6 +34,7 @@ class CityInfo { var workedTiles = HashSet() var isBeingRazed = false var attackedThisTurn = false + var hasSoldBuildingThisTurn = false constructor() // for json parsing, we need to have a default constructor constructor(civInfo: CivilizationInfo, cityLocation: Vector2) { @@ -245,7 +246,7 @@ class CityInfo { return false } - fun tryUpdateRoadStatus(){ + private fun tryUpdateRoadStatus(){ if(getCenterTile().roadStatus==RoadStatus.None && GameBasics.TileImprovements["Road"]!!.techRequired in civInfo.tech.techsResearched) getCenterTile().roadStatus==RoadStatus.Road @@ -254,5 +255,13 @@ class CityInfo { && GameBasics.TileImprovements["Railroad"]!!.techRequired in civInfo.tech.techsResearched) getCenterTile().roadStatus==RoadStatus.Railroad } + + fun getGoldForSellingBuilding(buildingName:String) = GameBasics.Buildings[buildingName]!!.cost / 10 + + fun sellBuilding(buildingName:String){ + cityConstructions.builtBuildings.remove(buildingName) + cityConstructions.removeBuilding(buildingName) + civInfo.gold += getGoldForSellingBuilding(buildingName) + } //endregion } \ No newline at end of file diff --git a/core/src/com/unciv/ui/CivilopediaScreen.kt b/core/src/com/unciv/ui/CivilopediaScreen.kt index 8252fa62..0c5c3f40 100644 --- a/core/src/com/unciv/ui/CivilopediaScreen.kt +++ b/core/src/com/unciv/ui/CivilopediaScreen.kt @@ -9,6 +9,7 @@ import com.unciv.models.gamebasics.GameBasics import com.unciv.models.gamebasics.ICivilopedia import com.unciv.ui.utils.CameraStageBaseScreen import com.unciv.ui.utils.onClick +import com.unciv.ui.utils.toLabel import java.util.* class CivilopediaScreen : CameraStageBaseScreen() { @@ -23,7 +24,7 @@ class CivilopediaScreen : CameraStageBaseScreen() { stage.addActor(splitPane) - val label = Label("", CameraStageBaseScreen.skin) + val label = "".toLabel() label.setWrap(true) val goToGameButton = TextButton("Return \r\nto game", CameraStageBaseScreen.skin) diff --git a/core/src/com/unciv/ui/EmpireOverviewScreen.kt b/core/src/com/unciv/ui/EmpireOverviewScreen.kt index c4614f47..b9c3fee8 100644 --- a/core/src/com/unciv/ui/EmpireOverviewScreen.kt +++ b/core/src/com/unciv/ui/EmpireOverviewScreen.kt @@ -3,7 +3,6 @@ package com.unciv.ui import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.Actor import com.badlogic.gdx.scenes.scene2d.Group -import com.badlogic.gdx.scenes.scene2d.ui.Label import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane import com.badlogic.gdx.scenes.scene2d.ui.Table import com.badlogic.gdx.scenes.scene2d.ui.TextButton @@ -64,7 +63,7 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){ topTable.add(setCurrentTradesButton) val setUnitsButton = TextButton("Units".tr(),skin) - setUnitsButton .onClick { + setUnitsButton.onClick { centerTable.clear() centerTable.add(ScrollPane(getUnitTable())).height(stage.height*0.8f) centerTable.pack() @@ -110,15 +109,15 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){ val table = Table() table.defaults().pad(10f) table.background = ImageGetter.getBackground(civ.getNation().getColor()) - table.add(Label(civ.civName.tr(),skin).setFontColor(civ.getNation().getSecondaryColor())).row() + table.add(civ.civName.toLabel().setFontColor(civ.getNation().getSecondaryColor())).row() table.addSeparator() for(offer in offersList){ var offerText = offer.amount.toString()+" "+offer.name.tr() if(offer.duration>0)offerText += " ("+offer.duration+" {turns})".tr() - table.add(Label(offerText,skin).setFontColor(civ.getNation().getSecondaryColor())).row() + table.add(offerText.toLabel().setFontColor(civ.getNation().getSecondaryColor())).row() } for(i in 1..numberOfOtherSidesOffers - offersList.size) - table.add(Label("",skin)).row() // we want both sides of the general table to have the same number of rows + table.add("".toLabel()).row() // we want both sides of the general table to have the same number of rows return table } @@ -126,7 +125,7 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){ private fun getHappinessTable(): Table { val happinessTable = Table(skin) happinessTable.defaults().pad(5f) - happinessTable.add(Label("Happiness".tr(), skin).setFontSize(24)).colspan(2).row() + happinessTable.add("Happiness".toLabel().setFontSize(24)).colspan(2).row() happinessTable.addSeparator() for (entry in currentPlayerCivInfo.getHappinessForNextTurn()) { happinessTable.add(entry.key.tr()) @@ -141,7 +140,7 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){ private fun getGoldTable(): Table { val goldTable = Table(skin) goldTable.defaults().pad(5f) - goldTable.add(Label("Gold".tr(), skin).setFontSize(24)).colspan(2).row() + goldTable.add("Gold".toLabel().setFontSize(24)).colspan(2).row() goldTable.addSeparator() var total=0f for (entry in currentPlayerCivInfo.getStatMapForNextTurn()) { @@ -165,7 +164,7 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){ val pointsToGreatPerson = currentPlayerCivInfo.greatPeople.pointsForNextGreatPerson greatPeopleTable.defaults().pad(5f) - greatPeopleTable.add(Label("Great person points".tr(), skin).setFontSize(24)).colspan(3).row() + greatPeopleTable.add("Great person points".toLabel().setFontSize(24)).colspan(3).row() greatPeopleTable.addSeparator() greatPeopleTable.add() greatPeopleTable.add("Current points") @@ -180,7 +179,7 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){ val pointsForGreatGeneral = currentPlayerCivInfo.greatPeople.greatGeneralPoints.toInt().toString() val pointsForNextGreatGeneral = currentPlayerCivInfo.greatPeople.pointsForNextGreatGeneral.toInt().toString() greatPeopleTable.add("Great General".tr()) - greatPeopleTable.add(pointsForGreatGeneral+"/"+pointsForNextGreatGeneral).row() + greatPeopleTable.add("$pointsForGreatGeneral/$pointsForNextGreatGeneral").row() greatPeopleTable.pack() return greatPeopleTable } @@ -194,7 +193,7 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){ val cityInfoTableIcons = Table(skin) cityInfoTableIcons.defaults().pad(padding).align(Align.center) - cityInfoTableIcons.add(Label("Cities".tr(), skin).setFontSize(24)).colspan(8).align(Align.center).row() + cityInfoTableIcons.add("Cities".toLabel().setFontSize(24)).colspan(8).align(Align.center).row() cityInfoTableIcons.add() cityInfoTableIcons.add(ImageGetter.getStatIcon("Population")).size(iconSize) cityInfoTableIcons.add(ImageGetter.getStatIcon("Food")).size(iconSize) @@ -305,7 +304,7 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){ var civNameText = civ.civName.tr() if(civ.isDefeated()) civNameText += "\n({Defeated})".tr() - val label = Label(civNameText, CameraStageBaseScreen.skin) + val label = civNameText.toLabel() label.setAlignment(Align.center) if (civ.isDefeated()) { diff --git a/core/src/com/unciv/ui/LanguagePickerScreen.kt b/core/src/com/unciv/ui/LanguagePickerScreen.kt index f273ea5c..306660ff 100644 --- a/core/src/com/unciv/ui/LanguagePickerScreen.kt +++ b/core/src/com/unciv/ui/LanguagePickerScreen.kt @@ -85,7 +85,7 @@ class LanguagePickerScreen: PickerScreen(){ "Do you want to download fonts for $spaceSplitLang?", { val downloading = PopupTable(this) - downloading.add(Label("Downloading...",skin)) + downloading.add("Downloading...".toLabel()) downloading.open() Gdx.input.inputProcessor = null // no interaction until download is over diff --git a/core/src/com/unciv/ui/NationTable.kt b/core/src/com/unciv/ui/NationTable.kt index 75bd78b7..ddcd4e51 100644 --- a/core/src/com/unciv/ui/NationTable.kt +++ b/core/src/com/unciv/ui/NationTable.kt @@ -12,6 +12,7 @@ import com.unciv.models.gamebasics.tr import com.unciv.ui.utils.ImageGetter import com.unciv.ui.utils.onClick import com.unciv.ui.utils.setFontColor +import com.unciv.ui.utils.toLabel class NationTable(val nation: Nation, val newGameParameters: GameParameters, skin: Skin, width:Float, onClick:()->Unit): Table(skin){ val innerTable = Table() @@ -19,8 +20,9 @@ class NationTable(val nation: Nation, val newGameParameters: GameParameters, ski background= ImageGetter.getBackground(nation.getSecondaryColor()) innerTable.pad(10f) innerTable.background= ImageGetter.getBackground(nation.getColor()) - innerTable.add(Label(nation.leaderName.tr()+" - "+nation.name.tr(), skin).apply { setFontColor(nation.getSecondaryColor())}).row() - innerTable.add(Label(getUniqueLabel(nation), skin) + innerTable.add(Label(nation.leaderName.tr()+" - "+nation.name.tr(), skin) + .apply { setFontColor(nation.getSecondaryColor())}).row() + innerTable.add(getUniqueLabel(nation) .apply { setWrap(true);setFontColor(nation.getSecondaryColor())}) .width(width) onClick { @@ -37,7 +39,7 @@ class NationTable(val nation: Nation, val newGameParameters: GameParameters, ski add(innerTable) } - private fun getUniqueLabel(nation: Nation): String { + private fun getUniqueLabel(nation: Nation): Label { val textList = ArrayList() if(nation.unique!=null) { @@ -81,7 +83,7 @@ class NationTable(val nation: Nation, val newGameParameters: GameParameters, ski } - return textList.joinToString("\n").tr().trim() + return textList.joinToString("\n").tr().trim().toLabel() } diff --git a/core/src/com/unciv/ui/NewGameScreen.kt b/core/src/com/unciv/ui/NewGameScreen.kt index f7b84d0d..d06fb5cd 100644 --- a/core/src/com/unciv/ui/NewGameScreen.kt +++ b/core/src/com/unciv/ui/NewGameScreen.kt @@ -2,7 +2,10 @@ package com.unciv.ui import com.badlogic.gdx.Gdx import com.badlogic.gdx.scenes.scene2d.Actor -import com.badlogic.gdx.scenes.scene2d.ui.* +import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane +import com.badlogic.gdx.scenes.scene2d.ui.SelectBox +import com.badlogic.gdx.scenes.scene2d.ui.Skin +import com.badlogic.gdx.scenes.scene2d.ui.Table import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener import com.badlogic.gdx.utils.Array import com.unciv.GameStarter @@ -16,6 +19,7 @@ import com.unciv.ui.pickerscreens.PickerScreen import com.unciv.ui.utils.disable import com.unciv.ui.utils.enable import com.unciv.ui.utils.onClick +import com.unciv.ui.utils.toLabel import com.unciv.ui.worldscreen.WorldScreen import kotlin.concurrent.thread import kotlin.math.min @@ -77,7 +81,7 @@ class NewGameScreen: PickerScreen(){ mapTypes[type.toString()] = type } - val mapFileLabel = Label("{Map file}:".tr(),skin) + val mapFileLabel = "{Map file}:".toLabel() val mapFileSelectBox = getMapFileSelectBox() mapFileLabel.isVisible=false mapFileSelectBox.isVisible=false @@ -85,7 +89,7 @@ class NewGameScreen: PickerScreen(){ val mapTypeSelectBox = TranslatedSelectBox(mapTypes.keys, newGameParameters.mapType.toString(), skin) val worldSizeSelectBox = getWorldSizeSelectBox() - val worldSizeLabel = Label("{World size}:".tr(),skin) + val worldSizeLabel = "{World size}:".toLabel() mapTypeSelectBox.addListener(object : ChangeListener() { override fun changed(event: ChangeEvent?, actor: Actor?) { diff --git a/core/src/com/unciv/ui/cityscreen/CityInfoTable.kt b/core/src/com/unciv/ui/cityscreen/CityInfoTable.kt index d58d6ecc..c1697efa 100644 --- a/core/src/com/unciv/ui/cityscreen/CityInfoTable.kt +++ b/core/src/com/unciv/ui/cityscreen/CityInfoTable.kt @@ -38,7 +38,7 @@ class CityInfoTable(private val cityScreen: CityScreen) : Table(CameraStageBaseS val wondersExpander = ExpanderTab("Wonders".tr(),skin) for (building in wonders) { wondersExpander.innerTable.add(ImageGetter.getConstructionImage(building.name).surroundWithCircle(30f)) - wondersExpander.innerTable.add(Label(building.name.tr(), skin)).pad(5f).align(Align.left).row() + wondersExpander.innerTable.add(building.name.toLabel()).pad(5f).align(Align.left).row() } add(wondersExpander).row() } @@ -47,7 +47,7 @@ class CityInfoTable(private val cityScreen: CityScreen) : Table(CameraStageBaseS val specialistBuildingsExpander = ExpanderTab("Specialist Buildings".tr(),skin) for (building in specialistBuildings) { specialistBuildingsExpander.innerTable.add(ImageGetter.getConstructionImage(building.name).surroundWithCircle(30f)) - specialistBuildingsExpander.innerTable.add(Label(building.name.tr(), skin)).pad(5f) + specialistBuildingsExpander.innerTable.add(building.name.toLabel()).pad(5f) val specialistIcons = Table() specialistIcons.row().size(20f).pad(5f) for(stat in building.specialistSlots!!.toHashMap()) @@ -66,7 +66,7 @@ class CityInfoTable(private val cityScreen: CityScreen) : Table(CameraStageBaseS val buildingsExpanderTab = ExpanderTab("Buildings".tr(),skin) for (building in otherBuildings) { buildingsExpanderTab.innerTable.add(ImageGetter.getConstructionImage(building.name).surroundWithCircle(30f)) - buildingsExpanderTab.innerTable.add(Label(building.name.tr(), skin)).pad(5f).row() + buildingsExpanderTab.innerTable.add(building.name.toLabel()).pad(5f).row() } add(buildingsExpanderTab).row() } @@ -96,13 +96,14 @@ class CityInfoTable(private val cityScreen: CityScreen) : Table(CameraStageBaseS for(stat in statToCauses){ val expander = ExpanderTab(stat.key.name.tr(),skin) expander.innerTable.defaults().pad(2f) + for(entry in stat.value) { - expander.innerTable.add(Label(entry.key.tr(), skin)) - expander.innerTable.add(Label(DecimalFormat("0.#").format(entry.value), skin)).row() + expander.innerTable.add(entry.key.toLabel()) + expander.innerTable.add(DecimalFormat("0.#").format(entry.value).toLabel()).row() } if(stat.value.isNotEmpty()){ - expander.innerTable.add(Label("Total".tr(),skin)) - expander.innerTable.add(Label(DecimalFormat("0.#").format(stat.value.values.sum()),skin)) + expander.innerTable.add("Total".toLabel()) + expander.innerTable.add(DecimalFormat("0.#").format(stat.value.values.sum()).toLabel()) add(expander).row() } } diff --git a/core/src/com/unciv/ui/cityscreen/CityScreen.kt b/core/src/com/unciv/ui/cityscreen/CityScreen.kt index 498d5a0b..32d16063 100644 --- a/core/src/com/unciv/ui/cityscreen/CityScreen.kt +++ b/core/src/com/unciv/ui/cityscreen/CityScreen.kt @@ -20,14 +20,26 @@ import kotlin.math.round class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() { private var selectedTile: TileInfo? = null - private var tileTable = Table() - private var cityInfoTable = CityInfoTable(this) - private var constructionsTable = ConstructionsTable(this) - private var cityPickerTable = Table() - private var razeCityButtonHolder = Table() - private var tileGroups = ArrayList() + // Clockwise from the top-left + /** Displays city stats - sits on the top left side */ var topCityStatsTable=Table() + private var razeCityButtonHolder = Table() // sits on the top + + /** Displays buildings, specialists and stats drilldown - sits on the top left of the city screen */ + private var cityInfoTable = CityInfoTable(this) + + /** Displays tile info, sits on the bottom right */ + private var tileTable = Table() + + /** Displays city name, allows switching between cities - sits on the bottom */ + private var cityPickerTable = Table() + + /** Holds production list and current production - sits on the bottom left */ + private var constructionsTable = ConstructionsTable(this) + + private var tileGroups = ArrayList() + init { onBackButtonClicked { UnCivGame.Current.setWorldScreen(); dispose() } addTiles() @@ -131,7 +143,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() { if(stat.key==Stat.Happiness) continue val minitable=Table().padRight(5f).padLeft(5f) minitable.add(ImageGetter.getStatIcon(stat.key.name)).size(20f).padRight(3f) - minitable.add(Label(round(stat.value).toInt().toString(), CameraStageBaseScreen.skin)) + minitable.add(round(stat.value).toInt().toString().toLabel()) table.add(minitable) } return table.addBorder(2f, beige) @@ -335,4 +347,5 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() { tileTable.setPosition(stage.width - 5f - tileTable.width, 5f) stage.addActor(tileTable) } -} \ No newline at end of file +} + diff --git a/core/src/com/unciv/ui/cityscreen/ConstructionsTable.kt b/core/src/com/unciv/ui/cityscreen/ConstructionsTable.kt index 5633c7d2..da57ffe0 100644 --- a/core/src/com/unciv/ui/cityscreen/ConstructionsTable.kt +++ b/core/src/com/unciv/ui/cityscreen/ConstructionsTable.kt @@ -2,7 +2,6 @@ package com.unciv.ui.cityscreen import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.Touchable -import com.badlogic.gdx.scenes.scene2d.ui.Label import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane import com.badlogic.gdx.scenes.scene2d.ui.Table import com.badlogic.gdx.scenes.scene2d.ui.TextButton @@ -32,7 +31,7 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre pickProductionButton.background = ImageGetter.getBackground(Color.BLACK) pickProductionButton.add(ImageGetter.getConstructionImage(construction).surroundWithCircle(40f)).padRight(10f) - pickProductionButton.add(Label(buttonText, CameraStageBaseScreen.skin).setFontColor(Color.WHITE)) + pickProductionButton.add(buttonText.toLabel().setFontColor(Color.WHITE)) pickProductionButton.onClick { cityScreen.city.cityConstructions.currentConstruction = construction update() @@ -58,7 +57,7 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre if(list.isEmpty()) return val titleTable = Table() titleTable.background = ImageGetter.getBackground(ImageGetter.getBlue()) - titleTable.add(Label(title.tr(),CameraStageBaseScreen.skin)) + titleTable.add(title.toLabel()) addSeparator() add(titleTable).fill().row() @@ -151,7 +150,7 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre .pad(5f) val buildingText = city.cityConstructions.getCityProductionTextForCityButton() - currentConstructionTable.add(Label(buildingText, CameraStageBaseScreen.skin).setFontColor(Color.WHITE)).row() + currentConstructionTable.add(buildingText.toLabel().setFontColor(Color.WHITE)).row() val currentConstruction = city.cityConstructions.getCurrentConstruction() val description: String @@ -161,7 +160,7 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre description = currentConstruction.getDescription(true, city.civInfo.policies.adoptedPolicies) else description = currentConstruction.description.tr() - val descriptionLabel = Label(description, CameraStageBaseScreen.skin) + val descriptionLabel = description.toLabel() descriptionLabel.setWrap(true) descriptionLabel.width = stage.width / 4 val descriptionScroll = ScrollPane(descriptionLabel) diff --git a/core/src/com/unciv/ui/pickerscreens/GreatPersonPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/GreatPersonPickerScreen.kt index 86ea3380..82b95b46 100644 --- a/core/src/com/unciv/ui/pickerscreens/GreatPersonPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/GreatPersonPickerScreen.kt @@ -2,14 +2,15 @@ package com.unciv.ui.pickerscreens import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.ui.Button -import com.badlogic.gdx.scenes.scene2d.ui.Label import com.unciv.UnCivGame import com.unciv.logic.civilization.GreatPersonManager import com.unciv.models.gamebasics.GameBasics +import com.unciv.models.gamebasics.tr import com.unciv.models.gamebasics.unit.BaseUnit import com.unciv.ui.utils.ImageGetter import com.unciv.ui.utils.onClick import com.unciv.ui.utils.setFontColor +import com.unciv.ui.utils.toLabel class GreatPersonPickerScreen : PickerScreen() { private var theChosenOne: BaseUnit? = null @@ -23,7 +24,7 @@ class GreatPersonPickerScreen : PickerScreen() { val button = Button(skin) button.add(ImageGetter.getUnitIcon(unit.name)).size(30f).pad(10f) - button.add(Label(unit.name, skin).setFontColor(Color.WHITE)).pad(10f) + button.add(unit.name.toLabel().setFontColor(Color.WHITE)).pad(10f) button.pack() button.onClick { theChosenOne = unit @@ -41,4 +42,4 @@ class GreatPersonPickerScreen : PickerScreen() { } } -} +} \ No newline at end of file diff --git a/core/src/com/unciv/ui/pickerscreens/PickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/PickerScreen.kt index bcdfe986..3eef8850 100644 --- a/core/src/com/unciv/ui/pickerscreens/PickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/PickerScreen.kt @@ -3,10 +3,7 @@ package com.unciv.ui.pickerscreens import com.badlogic.gdx.scenes.scene2d.ui.* import com.badlogic.gdx.utils.Align import com.unciv.models.gamebasics.tr -import com.unciv.ui.utils.CameraStageBaseScreen -import com.unciv.ui.utils.disable -import com.unciv.ui.utils.enable -import com.unciv.ui.utils.onClick +import com.unciv.ui.utils.* open class PickerScreen : CameraStageBaseScreen() { @@ -22,7 +19,7 @@ open class PickerScreen : CameraStageBaseScreen() { init { bottomTable.add(closeButton).width(stage.width / 4) - descriptionLabel = Label("", CameraStageBaseScreen.skin) + descriptionLabel = "".toLabel() descriptionLabel.setWrap(true) val labelScroll = ScrollPane(descriptionLabel) bottomTable.add(labelScroll).pad(5f).width(stage.width / 2) diff --git a/core/src/com/unciv/ui/pickerscreens/PromotionPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/PromotionPickerScreen.kt index cea885d0..e8a65fe0 100644 --- a/core/src/com/unciv/ui/pickerscreens/PromotionPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/PromotionPickerScreen.kt @@ -2,7 +2,6 @@ package com.unciv.ui.pickerscreens import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.ui.Button -import com.badlogic.gdx.scenes.scene2d.ui.Label import com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup import com.unciv.UnCivGame import com.unciv.logic.map.MapUnit @@ -37,7 +36,7 @@ class PromotionPickerScreen(mapUnit: MapUnit) : PickerScreen() { if(!isPromotionAvailable) promotionButton.color = Color.GRAY promotionButton.add(ImageGetter.getPromotionIcon(promotion.name)).size(30f).pad(10f) - promotionButton.add(Label(promotion.name, skin) + promotionButton.add(promotion.name.toLabel() .setFontColor(Color.WHITE)).pad(10f) if(unitHasPromotion) promotionButton.color = Color.GREEN diff --git a/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt index a54ef4fc..e6d895a7 100644 --- a/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt @@ -51,7 +51,8 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen() } val eras = ArrayList