fixed global politics screen from revealing unknown civs and CityStates (#8165)

* added mod topics to wiki

* fixed stats from revealing unknown civs and cityStates

* Revert "added mod topics to wiki"

This reverts commit 5528950a96.

* used knows() instead of getKnownCivs().contains()
This commit is contained in:
alexban011 2022-12-18 07:26:13 +02:00 committed by GitHub
parent 0380773560
commit 9aa3cb13c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,6 +173,9 @@ class GlobalPoliticsOverviewTable (
// wars // wars
for (otherCiv in civ.getKnownCivs()) { for (otherCiv in civ.getKnownCivs()) {
if (!viewingPlayer.knows(otherCiv))
continue
if(civ.isAtWarWith(otherCiv)) { if(civ.isAtWarWith(otherCiv)) {
val warText = "At war with [${otherCiv.civName}]".toLabel() val warText = "At war with [${otherCiv.civName}]".toLabel()
warText.color = Color.RED warText.color = Color.RED
@ -183,6 +186,9 @@ class GlobalPoliticsOverviewTable (
// declaration of friendships // declaration of friendships
for (otherCiv in civ.getKnownCivs()) { for (otherCiv in civ.getKnownCivs()) {
if (!viewingPlayer.knows(otherCiv))
continue
if(civ.diplomacy[otherCiv.civName]?.hasFlag(DiplomacyFlags.DeclarationOfFriendship) == true) { if(civ.diplomacy[otherCiv.civName]?.hasFlag(DiplomacyFlags.DeclarationOfFriendship) == true) {
val friendtext = "Friends with [${otherCiv.civName}]".toLabel() val friendtext = "Friends with [${otherCiv.civName}]".toLabel()
friendtext.color = Color.GREEN friendtext.color = Color.GREEN
@ -195,6 +201,9 @@ class GlobalPoliticsOverviewTable (
// denounced civs // denounced civs
for (otherCiv in civ.getKnownCivs()) { for (otherCiv in civ.getKnownCivs()) {
if (!viewingPlayer.knows(otherCiv))
continue
if(civ.diplomacy[otherCiv.civName]?.hasFlag(DiplomacyFlags.Denunciation) == true) { if(civ.diplomacy[otherCiv.civName]?.hasFlag(DiplomacyFlags.Denunciation) == true) {
val denouncedText = "Denounced [${otherCiv.civName}]".toLabel() val denouncedText = "Denounced [${otherCiv.civName}]".toLabel()
denouncedText.color = Color.RED denouncedText.color = Color.RED
@ -207,6 +216,9 @@ class GlobalPoliticsOverviewTable (
//allied CS //allied CS
for (cityState in gameInfo.getAliveCityStates()) { for (cityState in gameInfo.getAliveCityStates()) {
if (!viewingPlayer.knows(cityState))
continue
if (cityState.diplomacy[civ.civName]?.relationshipLevel() == RelationshipLevel.Ally) { if (cityState.diplomacy[civ.civName]?.relationshipLevel() == RelationshipLevel.Ally) {
val alliedText = "Allied with [${cityState.civName}]".toLabel() val alliedText = "Allied with [${cityState.civName}]".toLabel()
alliedText.color = Color.GREEN alliedText.color = Color.GREEN