Improved Spectator selected Civ coloring (#10992)

* Spectators now use the colors of the selected civ instead of the viewing civ

* Spectator now sees all city construction, growth bars and nation icons
This commit is contained in:
Oskar Niesen 2024-01-24 15:42:02 -06:00 committed by GitHub
parent 4a72213cde
commit 9522355752
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -111,13 +111,12 @@ private class DefenceTable(city: City) : BorderedTable(
init {
val viewingCiv = GUI.getViewingPlayer()
val selectedCiv = GUI.getSelectedPlayer()
borderSize = 4f
bgColor = Color.BLACK
bgBorderColor = when {
city.civ == viewingCiv -> colorFromRGB(255, 237, 200)
city.civ.isAtWarWith(viewingCiv) -> Color.RED
city.civ == selectedCiv -> colorFromRGB(255, 237, 200)
city.civ.isAtWarWith(selectedCiv) -> Color.RED
else -> Color.BLACK
}
@ -164,9 +163,9 @@ private class StatusTable(city: City, iconSize: Float = 18f) : Table() {
init {
val padBetween = 2f
val viewingCiv = GUI.getViewingPlayer()
val selectedCiv = GUI.getSelectedPlayer()
if (city.civ == viewingCiv) {
if (city.civ == selectedCiv) {
if (city.isBlockaded()) {
val connectionImage = ImageGetter.getImage("OtherIcons/Blockade")
add(connectionImage).size(iconSize)
@ -192,7 +191,7 @@ private class StatusTable(city: City, iconSize: Float = 18f) : Table() {
add(fireImage).size(iconSize).padLeft(padBetween)
}
if (city.civ == viewingCiv && city.isWeLoveTheKingDayActive()) {
if (city.civ == selectedCiv && city.isWeLoveTheKingDayActive()) {
val wltkdImage = ImageGetter.getImage("OtherIcons/WLTKD")
add(wltkdImage).size(iconSize).padLeft(padBetween)
}
@ -209,26 +208,27 @@ private class CityTable(city: City, forPopup: Boolean = false) : BorderedTable(
isTransform = false
touchable = Touchable.enabled
val selectedCiv = GUI.getSelectedPlayer()
val viewingCiv = GUI.getViewingPlayer()
bgBorderColor = when {
city.civ == viewingCiv -> colorFromRGB(233, 233, 172)
city.civ.isAtWarWith(viewingCiv) -> colorFromRGB(230, 51, 0)
city.civ == selectedCiv -> colorFromRGB(233, 233, 172)
city.civ.isAtWarWith(selectedCiv) -> colorFromRGB(230, 51, 0)
else -> Color.BLACK
}
borderSize = when {
city.civ == viewingCiv -> 4f
city.civ.isAtWarWith(viewingCiv) -> 4f
city.civ == selectedCiv -> 4f
city.civ.isAtWarWith(selectedCiv) -> 4f
else -> 2f
}
bgColor = city.civ.nation.getOuterColor().cpy().apply { a = 0.9f }
borderOnTop = city.civ == viewingCiv
borderOnTop = city.civ == selectedCiv
pad(0f)
defaults().pad(0f)
val isShowDetailedInfo = DebugUtils.VISIBLE_MAP
|| city.civ == viewingCiv
|| city.civ == selectedCiv
|| viewingCiv.isSpectator()
addCityPopNumber(city)