mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-11 00:08:58 +07:00
Don't leak other civs in the game through LineChart colors. (#9263)
This commit is contained in:
@ -202,16 +202,22 @@ class LineChart(
|
|||||||
for (i in 1 until simplifiedScaledPoints.size) {
|
for (i in 1 until simplifiedScaledPoints.size) {
|
||||||
val a = simplifiedScaledPoints[i - 1]
|
val a = simplifiedScaledPoints[i - 1]
|
||||||
val b = simplifiedScaledPoints[i]
|
val b = simplifiedScaledPoints[i]
|
||||||
|
val selectedCivBackgroundColor =
|
||||||
|
if (viewingCiv == civ || viewingCiv.knows(civ)) civ.nation.getInnerColor()
|
||||||
|
else Color.LIGHT_GRAY
|
||||||
drawLine(
|
drawLine(
|
||||||
batch, a.x, a.y, b.x, b.y,
|
batch, a.x, a.y, b.x, b.y,
|
||||||
civ.nation.getInnerColor(), chartLineWidth * 3
|
selectedCivBackgroundColor, chartLineWidth * 3
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i in 1 until simplifiedScaledPoints.size) {
|
for (i in 1 until simplifiedScaledPoints.size) {
|
||||||
val a = simplifiedScaledPoints[i - 1]
|
val a = simplifiedScaledPoints[i - 1]
|
||||||
val b = simplifiedScaledPoints[i]
|
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
|
// Draw the selected Civ icon on its last datapoint
|
||||||
if (i == simplifiedScaledPoints.size - 1 && selectedCiv == civ && selectedCiv in lastTurnDataPoints) {
|
if (i == simplifiedScaledPoints.size - 1 && selectedCiv == civ && selectedCiv in lastTurnDataPoints) {
|
||||||
|
Reference in New Issue
Block a user