diff --git a/core/src/com/unciv/ui/cityscreen/CityStatsTable.kt b/core/src/com/unciv/ui/cityscreen/CityStatsTable.kt index 01eb4d6f51..3c245b38f0 100644 --- a/core/src/com/unciv/ui/cityscreen/CityStatsTable.kt +++ b/core/src/com/unciv/ui/cityscreen/CityStatsTable.kt @@ -63,7 +63,7 @@ class CityStatsTable(val cityScreen: CityScreen): Table() { } else "Stopped expansion".tr() if (cityInfo.expansion.chooseNewTileToOwn() != null) turnsToExpansionString += - " (${cityInfo.expansion.cultureStored}/${cityInfo.expansion.getCultureToNextTile()})" + " (${cityInfo.expansion.cultureStored}${Fonts.culture}/${cityInfo.expansion.getCultureToNextTile()}${Fonts.culture})" var turnsToPopString = when { @@ -74,17 +74,26 @@ class CityStatsTable(val cityScreen: CityScreen): Table() { -> "Food converts to production" else -> "Stopped population growth" }.tr() - turnsToPopString += " (${cityInfo.population.foodStored}/${cityInfo.population.getFoodToNextPopulation()})" + turnsToPopString += " (${cityInfo.population.foodStored}${Fonts.food}/${cityInfo.population.getFoodToNextPopulation()}${Fonts.food})" innerTable.add(unassignedPopString.toLabel()).row() innerTable.add(turnsToExpansionString.toLabel()).row() innerTable.add(turnsToPopString.toLabel()).row() - if (cityInfo.isInResistance()) - innerTable.add("In resistance for another [${cityInfo.getFlag(CityFlags.Resistance)}] turns".toLabel()).row() - if (cityInfo.isWeLoveTheKingDay()) - innerTable.add("We Love The King Day for another [${cityInfo.getFlag(CityFlags.WeLoveTheKing)}] turns".toLabel()).row() - else if (cityInfo.demandedResource != "") - innerTable.add("Demanding [${cityInfo.demandedResource}]".toLabel()).row() + + val tableWithIcons = Table() + tableWithIcons.defaults().pad(2f) + if (cityInfo.isInResistance()) { + tableWithIcons.add(ImageGetter.getImage("StatIcons/Resistance")).size(20f) + tableWithIcons.add("In resistance for another [${cityInfo.getFlag(CityFlags.Resistance)}] turns".toLabel()).row() + } + if (cityInfo.isWeLoveTheKingDay()) { + tableWithIcons.add(ImageGetter.getStatIcon("Food")).size(20f) + tableWithIcons.add("We Love The King Day for another [${cityInfo.getFlag(CityFlags.WeLoveTheKing)}] turns".toLabel()).row() + } else if (cityInfo.demandedResource != "") { + tableWithIcons.add(ImageGetter.getResourceImage(cityInfo.demandedResource, 20f)).padRight(5f) + tableWithIcons.add("Demanding [${cityInfo.demandedResource}]".toLabel()).left().row() + } + innerTable.add(tableWithIcons).row() } private fun addReligionInfo() { diff --git a/core/src/com/unciv/ui/utils/ExtensionFunctions.kt b/core/src/com/unciv/ui/utils/ExtensionFunctions.kt index d611665c6d..48eb95fee8 100644 --- a/core/src/com/unciv/ui/utils/ExtensionFunctions.kt +++ b/core/src/com/unciv/ui/utils/ExtensionFunctions.kt @@ -222,7 +222,7 @@ fun String.toLabel(fontColor: Color = Color.WHITE, fontSize: Int = 18): Label { // We don't want to use setFontSize and setFontColor because they set the font, // which means we need to rebuild the font cache which means more memory allocation. var labelStyle = BaseScreen.skin.get(Label.LabelStyle::class.java) - if(fontColor != Color.WHITE || fontSize != 18) { // if we want the default we don't need to create another style + if (fontColor != Color.WHITE || fontSize != 18) { // if we want the default we don't need to create another style labelStyle = Label.LabelStyle(labelStyle) // clone this to another labelStyle.fontColor = fontColor if (fontSize != 18) labelStyle.font = Fonts.font diff --git a/core/src/com/unciv/ui/utils/Fonts.kt b/core/src/com/unciv/ui/utils/Fonts.kt index 2b26efa7d5..4d2994d218 100644 --- a/core/src/com/unciv/ui/utils/Fonts.kt +++ b/core/src/com/unciv/ui/utils/Fonts.kt @@ -123,7 +123,7 @@ class NativeBitmapFontData( object Fonts { - /** All text is originally rendered in 50px (set in AndroidLauncher and DesktopLauncher), and thn scaled to fit the size of the text we need now. + /** All text is originally rendered in 50px (set in AndroidLauncher and DesktopLauncher), and then scaled to fit the size of the text we need now. * This has several advantages: It means we only render each character once (good for both runtime and RAM), * AND it means that our 'custom' emojis only need to be once size (50px) and they'll be rescaled for what's needed. */ const val ORIGINAL_FONT_SIZE = 50f