From 9aa3cb13c5161053742fb72eccd321fb3d17e27b Mon Sep 17 00:00:00 2001 From: alexban011 Date: Sun, 18 Dec 2022 07:26:13 +0200 Subject: [PATCH] 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 5528950a96ee7c258d74a57dbc6f0625397dd011. * used knows() instead of getKnownCivs().contains() --- .../ui/overviewscreen/GlobalPoliticsOverviewTable.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/com/unciv/ui/overviewscreen/GlobalPoliticsOverviewTable.kt b/core/src/com/unciv/ui/overviewscreen/GlobalPoliticsOverviewTable.kt index 5ca404d9b4..6fb81acb6e 100644 --- a/core/src/com/unciv/ui/overviewscreen/GlobalPoliticsOverviewTable.kt +++ b/core/src/com/unciv/ui/overviewscreen/GlobalPoliticsOverviewTable.kt @@ -173,6 +173,9 @@ class GlobalPoliticsOverviewTable ( // wars for (otherCiv in civ.getKnownCivs()) { + if (!viewingPlayer.knows(otherCiv)) + continue + if(civ.isAtWarWith(otherCiv)) { val warText = "At war with [${otherCiv.civName}]".toLabel() warText.color = Color.RED @@ -183,6 +186,9 @@ class GlobalPoliticsOverviewTable ( // declaration of friendships for (otherCiv in civ.getKnownCivs()) { + if (!viewingPlayer.knows(otherCiv)) + continue + if(civ.diplomacy[otherCiv.civName]?.hasFlag(DiplomacyFlags.DeclarationOfFriendship) == true) { val friendtext = "Friends with [${otherCiv.civName}]".toLabel() friendtext.color = Color.GREEN @@ -195,6 +201,9 @@ class GlobalPoliticsOverviewTable ( // denounced civs for (otherCiv in civ.getKnownCivs()) { + if (!viewingPlayer.knows(otherCiv)) + continue + if(civ.diplomacy[otherCiv.civName]?.hasFlag(DiplomacyFlags.Denunciation) == true) { val denouncedText = "Denounced [${otherCiv.civName}]".toLabel() denouncedText.color = Color.RED @@ -207,6 +216,9 @@ class GlobalPoliticsOverviewTable ( //allied CS for (cityState in gameInfo.getAliveCityStates()) { + if (!viewingPlayer.knows(cityState)) + continue + if (cityState.diplomacy[civ.civName]?.relationshipLevel() == RelationshipLevel.Ally) { val alliedText = "Allied with [${cityState.civName}]".toLabel() alliedText.color = Color.GREEN