mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 13:27:22 -04:00
Tweak Overview-Politics-Diagram for a defeated player (#11094)
* Adapt Overview Politics diagram view to show a defeated player a little more intuitively * Fix lines to defeated civ - each is drawn twice, one for each direction * Defeated civ has no relations on the table view as well
This commit is contained in:
parent
1ad8c69e60
commit
5568cc08c0
@ -206,6 +206,11 @@ class GlobalPoliticsOverviewTable(
|
|||||||
if (!viewingPlayer.knows(civ) && civ.civName != viewingPlayer.civName)
|
if (!viewingPlayer.knows(civ) && civ.civName != viewingPlayer.civName)
|
||||||
return politicsTable
|
return politicsTable
|
||||||
|
|
||||||
|
if (civ.isDefeated()) {
|
||||||
|
politicsTable.add("{Defeated} ${Fonts.death}".toLabel())
|
||||||
|
return politicsTable
|
||||||
|
}
|
||||||
|
|
||||||
// wars
|
// wars
|
||||||
for (otherCiv in civ.getKnownCivs()) {
|
for (otherCiv in civ.getKnownCivs()) {
|
||||||
if (civ.isAtWarWith(otherCiv)) {
|
if (civ.isAtWarWith(otherCiv)) {
|
||||||
@ -357,7 +362,9 @@ class GlobalPoliticsOverviewTable(
|
|||||||
add("[$relevantCivsCount] Civilizations in the game".toLabel()).colspan(columns).row()
|
add("[$relevantCivsCount] Civilizations in the game".toLabel()).colspan(columns).row()
|
||||||
add("Our Civilization:".toLabel()).colspan(columns).left().padLeft(10f).padTop(10f).row()
|
add("Our Civilization:".toLabel()).colspan(columns).left().padLeft(10f).padTop(10f).row()
|
||||||
add(getCivMiniTable(viewingPlayer)).left()
|
add(getCivMiniTable(viewingPlayer)).left()
|
||||||
add(viewingPlayer.calculateTotalScore().toInt().toLabel()).left().row()
|
val scoreText = if (viewingPlayer.isDefeated()) Fonts.death.toString()
|
||||||
|
else viewingPlayer.calculateTotalScore().toInt().toString()
|
||||||
|
add(scoreText.toLabel()).left().row()
|
||||||
val turnsTillNextDiplomaticVote = viewingPlayer.getTurnsTillNextDiplomaticVote() ?: return
|
val turnsTillNextDiplomaticVote = viewingPlayer.getTurnsTillNextDiplomaticVote() ?: return
|
||||||
add("Turns until the next\ndiplomacy victory vote: [$turnsTillNextDiplomaticVote]".toLabel()).colspan(columns).row()
|
add("Turns until the next\ndiplomacy victory vote: [$turnsTillNextDiplomaticVote]".toLabel()).colspan(columns).row()
|
||||||
}
|
}
|
||||||
@ -394,7 +401,10 @@ class GlobalPoliticsOverviewTable(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This is the 'spider net'-like polygon showing one line per civ-civ relation */
|
/** This is the 'spider net'-like polygon showing one line per civ-civ relation
|
||||||
|
* @param undefeatedCivs Civs to display - note the viewing player is always included, so it's possible the name is off and there's a dead civ included.
|
||||||
|
* @param freeSize Width and height this [Group] sizes itself to
|
||||||
|
*/
|
||||||
private class DiplomacyGroup(
|
private class DiplomacyGroup(
|
||||||
undefeatedCivs: Sequence<Civilization>,
|
undefeatedCivs: Sequence<Civilization>,
|
||||||
freeSize: Float
|
freeSize: Float
|
||||||
@ -466,8 +476,10 @@ class GlobalPoliticsOverviewTable(
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (civ in undefeatedCivs) {
|
for (civ in undefeatedCivs) {
|
||||||
|
if (civ.isDefeated()) continue // if you're dead, icon but no lines (One more turn mode after losing)
|
||||||
for (diplomacy in civ.diplomacy.values) {
|
for (diplomacy in civ.diplomacy.values) {
|
||||||
if (diplomacy.otherCiv() !in undefeatedCivs) continue
|
val otherCiv = diplomacy.otherCiv()
|
||||||
|
if (otherCiv !in undefeatedCivs || otherCiv.isDefeated()) continue
|
||||||
val civGroup = civGroups[civ.civName]!!
|
val civGroup = civGroups[civ.civName]!!
|
||||||
val otherCivGroup = civGroups[diplomacy.otherCivName]!!
|
val otherCivGroup = civGroups[diplomacy.otherCivName]!!
|
||||||
|
|
||||||
@ -482,7 +494,7 @@ class GlobalPoliticsOverviewTable(
|
|||||||
statusLine.color = if (diplomacy.diplomaticStatus == DiplomaticStatus.War) Color.RED
|
statusLine.color = if (diplomacy.diplomaticStatus == DiplomaticStatus.War) Color.RED
|
||||||
else if (diplomacy.diplomaticStatus == DiplomaticStatus.DefensivePact
|
else if (diplomacy.diplomaticStatus == DiplomaticStatus.DefensivePact
|
||||||
|| (diplomacy.civInfo.isCityState() && diplomacy.civInfo.getAllyCiv() == diplomacy.otherCivName)
|
|| (diplomacy.civInfo.isCityState() && diplomacy.civInfo.getAllyCiv() == diplomacy.otherCivName)
|
||||||
|| (diplomacy.otherCiv().isCityState() && diplomacy.otherCiv().getAllyCiv() == diplomacy.civInfo.civName)
|
|| (otherCiv.isCityState() && otherCiv.getAllyCiv() == diplomacy.civInfo.civName)
|
||||||
) Color.CYAN
|
) Color.CYAN
|
||||||
else diplomacy.relationshipLevel().color
|
else diplomacy.relationshipLevel().color
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user