Less confusing time frames for charts
This commit is contained in:
parent
5898ae0b19
commit
4bbcbc8ea6
@ -73,7 +73,15 @@ open class DecimalHistoryChartPanel<out S : MatteryScreen<*>>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
result.add(TextComponent(""))
|
result.add(TextComponent(""))
|
||||||
result.add(TranslatableComponent("otm.gui.ago", formatTickDuration(it * chart.resolution, true)))
|
|
||||||
|
if (chart.resolution <= 20) {
|
||||||
|
result.add(TranslatableComponent("otm.gui.ago", formatTickDuration(it * chart.resolution, false)))
|
||||||
|
} else {
|
||||||
|
val useLongFormat = chart.resolution * chart.width / 20 > 99 * 60
|
||||||
|
result.add(TranslatableComponent("otm.gui.ago", formatTickDuration(it * chart.resolution, useLongFormat) + "-" + formatTickDuration((it + 1) * chart.resolution, useLongFormat)))
|
||||||
|
result.add(TextComponent("(${formatTickDuration(chart.resolution, useLongFormat)})"))
|
||||||
|
}
|
||||||
|
|
||||||
result
|
result
|
||||||
},
|
},
|
||||||
font,
|
font,
|
||||||
|
Loading…
Reference in New Issue
Block a user