Skip to content

Commit

Permalink
Improve income warning color (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
VDuchauffour authored Sep 2, 2024
1 parent 20166cc commit 6218bd2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Assets/Python/screens/CvMainInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions Assets/XML/Text/External/BUG_CIV4GameText.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@
<Italian>[SPACE][COLOR_YELLOW](%D1_Change/Turno)[COLOR_REVERT]</Italian>
<Spanish>[SPACE][COLOR_YELLOW](%D1_Change/turno)[COLOR_REVERT]</Spanish>
</TEXT>
<TEXT>
<Tag>TXT_KEY_MISC_NEG_STRONG_WARNING_GOLD_PER_TURN</Tag>
<English>[SPACE][COLOR_PLAYER_ORANGE_TEXT](%D1_Change/Turn)[COLOR_REVERT]</English>
<French>[SPACE][COLOR_ORANGE](%D1_Change/tour)[COLOR_REVERT]</French>
<German>[SPACE][COLOR_ORANGE](%D1_Change/Runde)[COLOR_REVERT]</German>
<Italian>[SPACE][COLOR_ORANGE](%D1_Change/Turno)[COLOR_REVERT]</Italian>
<Spanish>[SPACE][COLOR_ORANGE](%D1_Change/turno)[COLOR_REVERT]</Spanish>
</TEXT>
<TEXT>
<Tag>TXT_KEY_MISC_POS_WARNING_GOLD_PER_TURN</Tag>
<English>[SPACE][COLOR_YELLOW](%D1_Change/Turn)[COLOR_REVERT]</English>
Expand Down

0 comments on commit 6218bd2

Please sign in to comment.