aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/dulkirfabric/util
diff options
context:
space:
mode:
authoringlettronald <inglettronald@gmail.com>2023-07-23 10:24:53 -0500
committeringlettronald <inglettronald@gmail.com>2023-07-23 10:24:53 -0500
commitb76ffd5ce3e181d23988fc3bd41c30edd84457a9 (patch)
tree03def20314120f6b1eac46251e66f1a55ef2b04a /src/main/kotlin/com/dulkirfabric/util
parentc2f12fc024ed726b9b4479decfcb90ddefc6f52a (diff)
downloadDulkirMod-Fabric-b76ffd5ce3e181d23988fc3bd41c30edd84457a9.tar.gz
DulkirMod-Fabric-b76ffd5ce3e181d23988fc3bd41c30edd84457a9.tar.bz2
DulkirMod-Fabric-b76ffd5ce3e181d23988fc3bd41c30edd84457a9.zip
wip
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/util')
-rw-r--r--src/main/kotlin/com/dulkirfabric/util/JarvisIntegrationPlugin.kt15
-rw-r--r--src/main/kotlin/com/dulkirfabric/util/render/HudElement.kt57
-rw-r--r--src/main/kotlin/com/dulkirfabric/util/render/HudElementDefaultPositionings.kt8
3 files changed, 80 insertions, 0 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/util/JarvisIntegrationPlugin.kt b/src/main/kotlin/com/dulkirfabric/util/JarvisIntegrationPlugin.kt
new file mode 100644
index 0000000..e1f986b
--- /dev/null
+++ b/src/main/kotlin/com/dulkirfabric/util/JarvisIntegrationPlugin.kt
@@ -0,0 +1,15 @@
+package com.dulkirfabric.util
+
+import com.dulkirfabric.config.DulkirConfig
+import moe.nea.jarvis.api.JarvisHud
+import moe.nea.jarvis.api.JarvisPlugin
+
+class JarvisIntegrationPlugin: JarvisPlugin {
+ override fun getModId(): String {
+ return "dulkirmod-fabric"
+ }
+
+ override fun getAllHuds(): List<JarvisHud> {
+ return DulkirConfig.Huds.values.toList()
+ }
+} \ No newline at end of file
diff --git a/src/main/kotlin/com/dulkirfabric/util/render/HudElement.kt b/src/main/kotlin/com/dulkirfabric/util/render/HudElement.kt
new file mode 100644
index 0000000..824c745
--- /dev/null
+++ b/src/main/kotlin/com/dulkirfabric/util/render/HudElement.kt
@@ -0,0 +1,57 @@
+package com.dulkirfabric.util.render
+
+import kotlinx.serialization.Serializable
+import moe.nea.jarvis.api.JarvisHud
+import moe.nea.jarvis.api.JarvisScalable
+import net.minecraft.text.Text
+
+class HudElement (var positioning: Positioning,
+ private val label: Text,
+ private val width: Int,
+ private val height: Int
+ ): JarvisHud, JarvisScalable {
+
+ @Serializable
+ data class Positioning(
+ var x: Double,
+ var y: Double,
+ var scale: Float
+ )
+
+ override fun getX(): Double {
+ return positioning.x
+ }
+
+ override fun setX(newX: Double) {
+ positioning.x = newX
+ }
+
+ override fun getY(): Double {
+ return positioning.y
+ }
+
+ override fun setY(newY: Double) {
+ positioning.y = newY
+ }
+
+ override fun getLabel(): Text {
+ return label
+ }
+
+ override fun getWidth(): Int {
+ return width
+ }
+
+ override fun getHeight(): Int {
+ return height
+ }
+
+ override fun getScale(): Float {
+ return positioning.scale
+ }
+
+ override fun setScale(newScale: Float) {
+ positioning.scale = newScale
+ }
+
+} \ No newline at end of file
diff --git a/src/main/kotlin/com/dulkirfabric/util/render/HudElementDefaultPositionings.kt b/src/main/kotlin/com/dulkirfabric/util/render/HudElementDefaultPositionings.kt
new file mode 100644
index 0000000..9d27158
--- /dev/null
+++ b/src/main/kotlin/com/dulkirfabric/util/render/HudElementDefaultPositionings.kt
@@ -0,0 +1,8 @@
+package com.dulkirfabric.util.render
+
+import kotlinx.serialization.Serializable
+
+@Serializable
+data class HudElementDefaultPositionings(
+ var fooPos: HudElement.Positioning = HudElement.Positioning(.1, .1, 1f)
+)