From 19920ffbae9bb0118a4351c6b5923f697b0bc6c6 Mon Sep 17 00:00:00 2001 From: WhoIsJohannes <126110113+WhoIsJohannes@users.noreply.github.com> Date: Sun, 23 Apr 2023 22:26:41 +0200 Subject: [PATCH] Don't leak other civs in the game through LineChart colors. (#9263) --- core/src/com/unciv/ui/components/LineChart.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/ui/components/LineChart.kt b/core/src/com/unciv/ui/components/LineChart.kt index 219b2928f3..c1ff26d71a 100644 --- a/core/src/com/unciv/ui/components/LineChart.kt +++ b/core/src/com/unciv/ui/components/LineChart.kt @@ -202,16 +202,22 @@ class LineChart( for (i in 1 until simplifiedScaledPoints.size) { val a = simplifiedScaledPoints[i - 1] val b = simplifiedScaledPoints[i] + val selectedCivBackgroundColor = + if (viewingCiv == civ || viewingCiv.knows(civ)) civ.nation.getInnerColor() + else Color.LIGHT_GRAY drawLine( batch, a.x, a.y, b.x, b.y, - civ.nation.getInnerColor(), chartLineWidth * 3 + selectedCivBackgroundColor, chartLineWidth * 3 ) } } for (i in 1 until simplifiedScaledPoints.size) { val a = simplifiedScaledPoints[i - 1] val b = simplifiedScaledPoints[i] - drawLine(batch, a.x, a.y, b.x, b.y, civ.nation.getOuterColor(), chartLineWidth) + val civLineColor = + if (viewingCiv == civ || viewingCiv.knows(civ)) civ.nation.getOuterColor() + else Color.DARK_GRAY + drawLine(batch, a.x, a.y, b.x, b.y, civLineColor, chartLineWidth) // Draw the selected Civ icon on its last datapoint if (i == simplifiedScaledPoints.size - 1 && selectedCiv == civ && selectedCiv in lastTurnDataPoints) {