From 6218bd2a23708aa44ab48290620ffeaf3a6b6f7b Mon Sep 17 00:00:00 2001
From: Vincent Duchauffour <40724343+VDuchauffour@users.noreply.github.com>
Date: Mon, 2 Sep 2024 21:40:26 +0200
Subject: [PATCH] Improve income warning color (#59)
---
Assets/Python/screens/CvMainInterface.py | 15 ++++++++++++++-
Assets/XML/Text/External/BUG_CIV4GameText.xml | 8 ++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/Assets/Python/screens/CvMainInterface.py b/Assets/Python/screens/CvMainInterface.py
index efba8b14b..b1a7062b4 100644
--- a/Assets/Python/screens/CvMainInterface.py
+++ b/Assets/Python/screens/CvMainInterface.py
@@ -5298,6 +5298,12 @@ def updateGameDataStrings(self):
# Get the new modified gold string
iGoldRate = calculate_gold_rate(ePlayer)
# # < Mercenaries End >
+ iCurrentResearch = pPlayer.getCurrentResearch()
+ iResearchTurnsLeft = (
+ iCurrentResearch >= 0
+ and pPlayer.getResearchTurnsLeft(iCurrentResearch, True)
+ or None
+ )
if iGold < 0:
szText = BugUtil.getText("TXT_KEY_MISC_NEG_GOLD", iGold)
if iGoldRate != 0:
@@ -5320,10 +5326,17 @@ def updateGameDataStrings(self):
szText += BugUtil.getText(
"TXT_KEY_MISC_POS_GOLD_PER_TURN", iGoldRate
)
- elif iGold + iGoldRate >= 0:
+ elif (
+ iCurrentResearch >= 0
+ and iGold + iGoldRate * iResearchTurnsLeft >= 0
+ ):
szText += BugUtil.getText(
"TXT_KEY_MISC_NEG_WARNING_GOLD_PER_TURN", iGoldRate
)
+ elif iGold + iGoldRate >= 0:
+ szText += BugUtil.getText(
+ "TXT_KEY_MISC_NEG_STRONG_WARNING_GOLD_PER_TURN", iGoldRate
+ )
else:
szText += BugUtil.getText(
"TXT_KEY_MISC_NEG_GOLD_PER_TURN", iGoldRate
diff --git a/Assets/XML/Text/External/BUG_CIV4GameText.xml b/Assets/XML/Text/External/BUG_CIV4GameText.xml
index f1e1dc6a6..fba20e8c0 100644
--- a/Assets/XML/Text/External/BUG_CIV4GameText.xml
+++ b/Assets/XML/Text/External/BUG_CIV4GameText.xml
@@ -154,6 +154,14 @@
[SPACE][COLOR_YELLOW](%D1_Change/Turno)[COLOR_REVERT]
[SPACE][COLOR_YELLOW](%D1_Change/turno)[COLOR_REVERT]
+
+ TXT_KEY_MISC_NEG_STRONG_WARNING_GOLD_PER_TURN
+ [SPACE][COLOR_PLAYER_ORANGE_TEXT](%D1_Change/Turn)[COLOR_REVERT]
+ [SPACE][COLOR_ORANGE](%D1_Change/tour)[COLOR_REVERT]
+ [SPACE][COLOR_ORANGE](%D1_Change/Runde)[COLOR_REVERT]
+ [SPACE][COLOR_ORANGE](%D1_Change/Turno)[COLOR_REVERT]
+ [SPACE][COLOR_ORANGE](%D1_Change/turno)[COLOR_REVERT]
+
TXT_KEY_MISC_POS_WARNING_GOLD_PER_TURN
[SPACE][COLOR_YELLOW](%D1_Change/Turn)[COLOR_REVERT]