diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GraphRendering.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/ChartRendering.kt similarity index 96% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GraphRendering.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/render/ChartRendering.kt index c20392fce..10e37c3b9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GraphRendering.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/ChartRendering.kt @@ -9,7 +9,6 @@ import net.minecraft.client.gui.Font import net.minecraft.client.renderer.GameRenderer import net.minecraft.network.chat.Component import ru.dbotthepony.kommons.math.RGBAColor -import ru.dbotthepony.kommons.math.linearInterpolation import kotlin.math.PI import kotlin.math.acos import kotlin.math.cos @@ -22,7 +21,7 @@ private const val HIGHLIGHT_WIDTH = 3f private val TEXT_BACKGROUND = RGBAColor(0f, 0f, 0f, 0.5f) -data class GraphMouseLabels( +data class ChartMouseLabels( val mouseX: Float, val mouseY: Float, val labels: (Int) -> Component, @@ -33,13 +32,13 @@ data class GraphMouseLabels( val textBackgroundColor: RGBAColor = TEXT_BACKGROUND ) -fun renderGraph( +fun renderChart( poseStack: PoseStack, normalized: FloatArray, width: Float, height: Float, color: RGBAColor = RGBAColor.WHITE, - labels: GraphMouseLabels? = null, + labels: ChartMouseLabels? = null, x: Float = 0f, y: Float = 0f, ) { 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 6dff360f3..1936ae50b 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 @@ -2,9 +2,9 @@ package ru.dbotthepony.mc.otm.client.screen.panels import net.minecraft.network.chat.Component import ru.dbotthepony.kommons.math.RGBAColor -import ru.dbotthepony.mc.otm.client.render.GraphMouseLabels +import ru.dbotthepony.mc.otm.client.render.ChartMouseLabels import ru.dbotthepony.mc.otm.client.render.MGUIGraphics -import ru.dbotthepony.mc.otm.client.render.renderGraph +import ru.dbotthepony.mc.otm.client.render.renderChart import ru.dbotthepony.mc.otm.client.screen.MatteryScreen import ru.dbotthepony.mc.otm.core.DecimalHistoryChart import ru.dbotthepony.mc.otm.core.TextComponent @@ -34,12 +34,12 @@ open class DecimalHistoryChartPanel>( graphics.renderRect(0f, 0f, this.width, this.height, color = RGBAColor.BLACK) - renderGraph( + renderChart( graphics.pose, normalized, width, height, - labels = GraphMouseLabels( + labels = ChartMouseLabels( mouseX - absoluteX, mouseY - absoluteY, { formatText(graph[it]) },