mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-13 00:04:38 +07:00
Show line color in more cases (#9550)
This commit is contained in:
parent
d0acedd092
commit
edac7bcd04
@ -203,8 +203,7 @@ class LineChart(
|
|||||||
val a = simplifiedScaledPoints[i - 1]
|
val a = simplifiedScaledPoints[i - 1]
|
||||||
val b = simplifiedScaledPoints[i]
|
val b = simplifiedScaledPoints[i]
|
||||||
val selectedCivBackgroundColor =
|
val selectedCivBackgroundColor =
|
||||||
if (viewingCiv == civ || viewingCiv.knows(civ)) civ.nation.getInnerColor()
|
if (useActualColor(civ)) civ.nation.getInnerColor() else Color.LIGHT_GRAY
|
||||||
else Color.LIGHT_GRAY
|
|
||||||
drawLine(
|
drawLine(
|
||||||
batch, a.x, a.y, b.x, b.y,
|
batch, a.x, a.y, b.x, b.y,
|
||||||
selectedCivBackgroundColor, chartLineWidth * 3
|
selectedCivBackgroundColor, chartLineWidth * 3
|
||||||
@ -214,9 +213,7 @@ 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 civLineColor =
|
val civLineColor = if (useActualColor(civ)) civ.nation.getOuterColor() else Color.DARK_GRAY
|
||||||
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)
|
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
|
||||||
@ -244,6 +241,15 @@ class LineChart(
|
|||||||
batch.transformMatrix = oldTransformMatrix
|
batch.transformMatrix = oldTransformMatrix
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun useActualColor(civ: Civilization) : Boolean {
|
||||||
|
return viewingCiv.isSpectator() ||
|
||||||
|
viewingCiv.isDefeated() ||
|
||||||
|
viewingCiv.victoryManager.hasWon() ||
|
||||||
|
viewingCiv == civ ||
|
||||||
|
viewingCiv.knows(civ) ||
|
||||||
|
civ.isDefeated()
|
||||||
|
}
|
||||||
|
|
||||||
private fun getLastTurnDataPoints(): MutableMap<Civilization, DataPoint<Int>> {
|
private fun getLastTurnDataPoints(): MutableMap<Civilization, DataPoint<Int>> {
|
||||||
val lastDataPoints = mutableMapOf<Civilization, DataPoint<Int>>()
|
val lastDataPoints = mutableMapOf<Civilization, DataPoint<Int>>()
|
||||||
for (dataPoint in dataPoints) {
|
for (dataPoint in dataPoints) {
|
||||||
|
Loading…
Reference in New Issue
Block a user