Removed more double icons

This commit is contained in:
Yair Morgenstern
2023-04-13 23:01:48 +03:00
parent 0d6aa82540
commit d542fbc0af
9 changed files with 20 additions and 20 deletions

View File

@ -127,7 +127,7 @@ class CityConstructions : IsPartOfGameInfoSerialization {
fun getCityProductionTextForCityButton(): String { fun getCityProductionTextForCityButton(): String {
val currentConstructionSnapshot = currentConstructionFromQueue // See below val currentConstructionSnapshot = currentConstructionFromQueue // See below
var result = currentConstructionSnapshot.tr() var result = currentConstructionSnapshot.tr(true)
if (currentConstructionSnapshot.isNotEmpty()) { if (currentConstructionSnapshot.isNotEmpty()) {
val construction = PerpetualConstruction.perpetualConstructionsMap[currentConstructionSnapshot] val construction = PerpetualConstruction.perpetualConstructionsMap[currentConstructionSnapshot]
result += construction?.getProductionTooltip(city) result += construction?.getProductionTooltip(city)

View File

@ -25,7 +25,6 @@ import com.unciv.models.ruleset.unique.UniqueType
import com.unciv.models.ruleset.unit.BaseUnit import com.unciv.models.ruleset.unit.BaseUnit
import com.unciv.models.translations.fillPlaceholders import com.unciv.models.translations.fillPlaceholders
import com.unciv.models.translations.getPlaceholderParameters import com.unciv.models.translations.getPlaceholderParameters
import com.unciv.models.translations.tr
import com.unciv.ui.components.extensions.randomWeighted import com.unciv.ui.components.extensions.randomWeighted
import com.unciv.ui.components.extensions.toPercent import com.unciv.ui.components.extensions.toPercent
import kotlin.math.max import kotlin.math.max
@ -460,7 +459,7 @@ class QuestManager : IsPartOfGameInfoSerialization {
NotificationCategory.Diplomacy, civInfo.civName, "OtherIcons/Quest") NotificationCategory.Diplomacy, civInfo.civName, "OtherIcons/Quest")
} else { } else {
assignee.addNotification( assignee.addNotification(
"The [${assignedQuest.questName}] quest for [${civInfo.civName}] has ended. It was won by [${winners.joinToString { it.assignee.tr() }}].", "The [${assignedQuest.questName}] quest for [${civInfo.civName}] has ended. It was won by [${winners.joinToString { "{${it.assignee}}" }}].",
civInfo.getCapital()!!.location, civInfo.getCapital()!!.location,
NotificationCategory.Diplomacy, civInfo.civName, "OtherIcons/Quest") NotificationCategory.Diplomacy, civInfo.civName, "OtherIcons/Quest")
} }

View File

@ -307,7 +307,7 @@ class TechManager : IsPartOfGameInfoSerialization {
if (!civInfo.isSpectator()) if (!civInfo.isSpectator())
civInfo.addNotification("Research of [$techName] has completed!", TechAction(techName), civInfo.addNotification("Research of [$techName] has completed!", TechAction(techName),
NotificationCategory.General, NotificationCategory.General,
NotificationIcon.Science, techName) NotificationIcon.Science)
if (isNewTech) if (isNewTech)
civInfo.popupAlerts.add(PopupAlert(AlertType.TechResearched, techName)) civInfo.popupAlerts.add(PopupAlert(AlertType.TechResearched, techName))

View File

@ -313,7 +313,7 @@ class CityConstructionsTable(private val cityScreen: CityScreen) {
val isFirstConstructionOfItsKind = cityConstructions.isFirstConstructionOfItsKind(constructionQueueIndex, constructionName) val isFirstConstructionOfItsKind = cityConstructions.isFirstConstructionOfItsKind(constructionQueueIndex, constructionName)
var text = constructionName.tr() + var text = constructionName.tr(true) +
if (constructionName in PerpetualConstruction.perpetualConstructionsMap) "\n" if (constructionName in PerpetualConstruction.perpetualConstructionsMap) "\n"
else cityConstructions.getTurnsToConstructionString(constructionName, isFirstConstructionOfItsKind) else cityConstructions.getTurnsToConstructionString(constructionName, isFirstConstructionOfItsKind)
@ -386,7 +386,7 @@ class CityConstructionsTable(private val cityScreen: CityScreen) {
val resourceTable = Table().apply { isTransform = false } val resourceTable = Table().apply { isTransform = false }
val textColor = if (constructionButtonDTO.rejectionReason == null) Color.WHITE else Color.RED val textColor = if (constructionButtonDTO.rejectionReason == null) Color.WHITE else Color.RED
constructionTable.add(construction.name.toLabel(fontColor = textColor).apply { wrap=true }) constructionTable.add(construction.name.toLabel(fontColor = textColor, hideIcons = true).apply { wrap=true })
.width(cityScreen.stage.width/5).expandX().left().row() .width(cityScreen.stage.width/5).expandX().left().row()
resourceTable.add(constructionButtonDTO.buttonText.toLabel()).expandX().left() resourceTable.add(constructionButtonDTO.buttonText.toLabel()).expandX().left()

View File

@ -8,16 +8,14 @@ import com.badlogic.gdx.scenes.scene2d.ui.Table
import com.badlogic.gdx.utils.Align import com.badlogic.gdx.utils.Align
import com.unciv.Constants import com.unciv.Constants
import com.unciv.UncivGame import com.unciv.UncivGame
import com.unciv.logic.city.City
import com.unciv.logic.city.CityFlags import com.unciv.logic.city.CityFlags
import com.unciv.logic.city.CityFocus import com.unciv.logic.city.CityFocus
import com.unciv.logic.city.City
import com.unciv.models.ruleset.Building import com.unciv.models.ruleset.Building
import com.unciv.models.ruleset.unique.UniqueType import com.unciv.models.ruleset.unique.UniqueType
import com.unciv.models.stats.Stat import com.unciv.models.stats.Stat
import com.unciv.models.translations.tr import com.unciv.models.translations.tr
import com.unciv.ui.screens.civilopediascreen.CivilopediaScreen import com.unciv.ui.components.ColorMarkupLabel
import com.unciv.ui.images.ImageGetter
import com.unciv.ui.screens.basescreen.BaseScreen
import com.unciv.ui.components.ExpanderTab import com.unciv.ui.components.ExpanderTab
import com.unciv.ui.components.Fonts import com.unciv.ui.components.Fonts
import com.unciv.ui.components.extensions.addSeparator import com.unciv.ui.components.extensions.addSeparator
@ -29,6 +27,9 @@ import com.unciv.ui.components.extensions.surroundWithCircle
import com.unciv.ui.components.extensions.toGroup import com.unciv.ui.components.extensions.toGroup
import com.unciv.ui.components.extensions.toLabel import com.unciv.ui.components.extensions.toLabel
import com.unciv.ui.components.extensions.toTextButton import com.unciv.ui.components.extensions.toTextButton
import com.unciv.ui.images.ImageGetter
import com.unciv.ui.screens.basescreen.BaseScreen
import com.unciv.ui.screens.civilopediascreen.CivilopediaScreen
import kotlin.math.ceil import kotlin.math.ceil
import kotlin.math.round import kotlin.math.round
import com.unciv.ui.components.AutoScrollPane as ScrollPane import com.unciv.ui.components.AutoScrollPane as ScrollPane
@ -184,7 +185,7 @@ class CityStatsTable(val cityScreen: CityScreen): Table() {
"We Love The King Day for another [${cityInfo.getFlag(CityFlags.WeLoveTheKing)}] turns".toLabel(Color.LIME) "We Love The King Day for another [${cityInfo.getFlag(CityFlags.WeLoveTheKing)}] turns".toLabel(Color.LIME)
cityInfo.demandedResource.isNotEmpty() -> cityInfo.demandedResource.isNotEmpty() ->
ImageGetter.getResourcePortrait(cityInfo.demandedResource, 20f) to ImageGetter.getResourcePortrait(cityInfo.demandedResource, 20f) to
"Demanding [${cityInfo.demandedResource}]".toLabel(Color.CORAL) ColorMarkupLabel("Demanding [${cityInfo.demandedResource}]",Color.CORAL)
else -> null to null else -> null to null
} }
if (wltkLabel != null) { if (wltkLabel != null) {
@ -351,7 +352,7 @@ class CityStatsTable(val cityScreen: CityScreen): Table() {
info.add(ImageGetter.getUnitIcon(greatPersonName, Color.GOLD).toGroup(20f)) info.add(ImageGetter.getUnitIcon(greatPersonName, Color.GOLD).toGroup(20f))
.left().padBottom(4f).padRight(5f) .left().padBottom(4f).padRight(5f)
info.add("{$greatPersonName} (+$gppPerTurn)".toLabel()).left().padBottom(4f).expandX().row() info.add("{$greatPersonName} (+$gppPerTurn)".toLabel(hideIcons = true)).left().padBottom(4f).expandX().row()
val gppCurrent = city.civ.greatPeople.greatPersonPointsCounter[greatPersonName] val gppCurrent = city.civ.greatPeople.greatPersonPointsCounter[greatPersonName]
val gppNeeded = city.civ.greatPeople.getPointsRequiredForGreatPerson() val gppNeeded = city.civ.greatPeople.getPointsRequiredForGreatPerson()

View File

@ -119,7 +119,7 @@ class ImprovementPickerScreen(
if (isSuperseded) shortcutKey = null if (isSuperseded) shortcutKey = null
} }
var labelText = improvement.name.tr() var labelText = improvement.name.tr(true)
val turnsToBuild = if (tile.improvementInProgress == improvement.name) tile.turnsToImprovement val turnsToBuild = if (tile.improvementInProgress == improvement.name) tile.turnsToImprovement
else improvement.getTurnsToBuild(currentPlayerCiv, unit) else improvement.getTurnsToBuild(currentPlayerCiv, unit)

View File

@ -14,10 +14,7 @@ import com.unciv.models.TutorialTrigger
import com.unciv.models.UncivSound import com.unciv.models.UncivSound
import com.unciv.models.ruleset.unit.Promotion import com.unciv.models.ruleset.unit.Promotion
import com.unciv.models.translations.tr import com.unciv.models.translations.tr
import com.unciv.ui.images.ImageGetter
import com.unciv.ui.screens.basescreen.BaseScreen
import com.unciv.ui.components.BorderedTable import com.unciv.ui.components.BorderedTable
import com.unciv.ui.screens.basescreen.RecreateOnResize
import com.unciv.ui.components.extensions.colorFromRGB import com.unciv.ui.components.extensions.colorFromRGB
import com.unciv.ui.components.extensions.darken import com.unciv.ui.components.extensions.darken
import com.unciv.ui.components.extensions.isEnabled import com.unciv.ui.components.extensions.isEnabled
@ -26,6 +23,9 @@ import com.unciv.ui.components.extensions.onDoubleClick
import com.unciv.ui.components.extensions.setFontColor import com.unciv.ui.components.extensions.setFontColor
import com.unciv.ui.components.extensions.toLabel import com.unciv.ui.components.extensions.toLabel
import com.unciv.ui.components.extensions.toTextButton import com.unciv.ui.components.extensions.toTextButton
import com.unciv.ui.images.ImageGetter
import com.unciv.ui.screens.basescreen.BaseScreen
import com.unciv.ui.screens.basescreen.RecreateOnResize
import java.lang.Integer.max import java.lang.Integer.max
import kotlin.math.abs import kotlin.math.abs
@ -89,7 +89,7 @@ private class PromotionButton(
) { ) {
var isSelected = false var isSelected = false
val label = node.promotion.name.toLabel().apply { val label = node.promotion.name.toLabel(hideIcons = true).apply {
wrap = false wrap = false
setAlignment(Align.left) setAlignment(Align.left)
setEllipsis(true) setEllipsis(true)

View File

@ -84,7 +84,7 @@ internal class VictoryScreenCivGroup(
} }
background = BaseScreen.skinStrings.getUiBackground("VictoryScreen/CivGroup", BaseScreen.skinStrings.roundedEdgeRectangleShape, backgroundColor) background = BaseScreen.skinStrings.getUiBackground("VictoryScreen/CivGroup", BaseScreen.skinStrings.roundedEdgeRectangleShape, backgroundColor)
val label = labelText.toLabel(labelColor) val label = labelText.toLabel(labelColor, hideIcons = true)
label.setAlignment(Align.center) label.setAlignment(Align.center)
add(label).padLeft(10f) add(label).padLeft(10f)

View File

@ -144,13 +144,13 @@ class BattleTable(val worldScreen: WorldScreen): Table() {
clear() clear()
val attackerNameWrapper = Table() val attackerNameWrapper = Table()
val attackerLabel = attacker.getName().toLabel() val attackerLabel = attacker.getName().toLabel(hideIcons = true)
attackerNameWrapper.add(getIcon(attacker)).padRight(5f) attackerNameWrapper.add(getIcon(attacker)).padRight(5f)
attackerNameWrapper.add(attackerLabel) attackerNameWrapper.add(attackerLabel)
add(attackerNameWrapper) add(attackerNameWrapper)
val defenderNameWrapper = Table() val defenderNameWrapper = Table()
val defenderLabel = Label(defender.getName().tr(), skin) val defenderLabel = Label(defender.getName().tr(hideIcons = true), skin)
defenderNameWrapper.add(getIcon(defender)).padRight(5f) defenderNameWrapper.add(getIcon(defender)).padRight(5f)
defenderNameWrapper.add(defenderLabel) defenderNameWrapper.add(defenderLabel)