diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/DecimalHistoryChartPanel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/DecimalHistoryChartPanel.kt index 4bc772cde..313eacffa 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/DecimalHistoryChartPanel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/DecimalHistoryChartPanel.kt @@ -73,7 +73,15 @@ open class DecimalHistoryChartPanel>( } 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 }, font,