mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 23:37:31 +07:00
Fixed politics tab not showing defensive pacts (#10079)
* Override DoF displayed on Politics table with defensive pact when applicable and added CYAN color to table and diagram. * City-state alliances now show as CYAN in the politics table
This commit is contained in:
parent
ee81b3e84e
commit
c3484381c3
@ -1402,6 +1402,7 @@ Politics =
|
||||
Show global politics =
|
||||
Show diagram =
|
||||
At war with [enemy] =
|
||||
Defensive pact with [civName] =
|
||||
Friends with [civName] =
|
||||
an unknown civilization =
|
||||
[numberOfTurns] Turns Left =
|
||||
|
@ -187,9 +187,14 @@ class GlobalPoliticsOverviewTable (
|
||||
}
|
||||
politicsTable.row()
|
||||
|
||||
// declaration of friendships
|
||||
// defensive pacts and declaration of friendships
|
||||
for (otherCiv in civ.getKnownCivs()) {
|
||||
if (civ.diplomacy[otherCiv.civName]?.hasFlag(DiplomacyFlags.DeclarationOfFriendship) == true) {
|
||||
if (civ.diplomacy[otherCiv.civName]?.hasFlag(DiplomacyFlags.DefensivePact) == true) {
|
||||
val friendText = ColorMarkupLabel("Defensive pact with [${getCivName(otherCiv)}]", Color.CYAN)
|
||||
val turnsLeftText = " (${civ.diplomacy[otherCiv.civName]?.getFlag(DiplomacyFlags.DefensivePact)} ${Fonts.turn})".toLabel()
|
||||
politicsTable.add(friendText)
|
||||
politicsTable.add(turnsLeftText).row()
|
||||
} else if (civ.diplomacy[otherCiv.civName]?.hasFlag(DiplomacyFlags.DeclarationOfFriendship) == true) {
|
||||
val friendText = ColorMarkupLabel("Friends with [${getCivName(otherCiv)}]", Color.GREEN)
|
||||
val turnsLeftText = " (${civ.diplomacy[otherCiv.civName]?.getFlag(DiplomacyFlags.DeclarationOfFriendship)} ${Fonts.turn})".toLabel()
|
||||
politicsTable.add(friendText)
|
||||
@ -212,7 +217,7 @@ class GlobalPoliticsOverviewTable (
|
||||
//allied CS
|
||||
for (cityState in gameInfo.getAliveCityStates()) {
|
||||
if (cityState.diplomacy[civ.civName]?.isRelationshipLevelEQ(RelationshipLevel.Ally) == true) {
|
||||
val alliedText = ColorMarkupLabel("Allied with [${getCivName(cityState)}]", Color.GREEN)
|
||||
val alliedText = ColorMarkupLabel("Allied with [${getCivName(cityState)}]", Color.CYAN)
|
||||
politicsTable.add(alliedText).row()
|
||||
}
|
||||
}
|
||||
@ -435,6 +440,10 @@ class GlobalPoliticsOverviewTable (
|
||||
width = 2f)
|
||||
|
||||
statusLine.color = if (diplomacy.diplomaticStatus == DiplomaticStatus.War) Color.RED
|
||||
else if (diplomacy.diplomaticStatus == DiplomaticStatus.DefensivePact
|
||||
|| (diplomacy.civInfo.isCityState() && diplomacy.civInfo.getAllyCiv() == diplomacy.otherCivName)
|
||||
|| (diplomacy.otherCiv().isCityState() && diplomacy.otherCiv().getAllyCiv() == diplomacy.civInfo.civName)
|
||||
) Color.CYAN
|
||||
else diplomacy.relationshipLevel().color
|
||||
|
||||
if (!civLines.containsKey(civ.civName)) civLines[civ.civName] = mutableSetOf()
|
||||
|
Loading…
Reference in New Issue
Block a user