aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/gui/config/JAnyHud.kt
blob: f3f83b30b49b631fa4f4eed1cb76913859413805 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

package moe.nea.firmament.gui.config

import moe.nea.jarvis.api.JarvisHud
import moe.nea.jarvis.api.JarvisScalable
import kotlinx.serialization.Serializable
import net.minecraft.text.Text

@Serializable
data class HudPosition(
    var x: Double,
    var y: Double,
    var scale: Float,
)


data class HudMeta(
    val position: HudPosition,
    private val label: Text,
    private val width: Int,
    private val height: Int,
) : JarvisScalable, JarvisHud {
    override fun getX(): Double = position.x

    override fun setX(newX: Double) {
        position.x = newX
    }

    override fun getY(): Double = position.y

    override fun setY(newY: Double) {
        position.y = newY
    }

    override fun getLabel(): Text = label

    override fun getWidth(): Int = width

    override fun getHeight(): Int = height

    override fun getScale(): Float = position.scale

    override fun setScale(newScale: Float) {
        position.scale = newScale
    }

}