mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-05 21:11:35 +07:00
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:
parent
4a72213cde
commit
9522355752
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user