aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/gui
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-06-14 18:34:40 +0200
committerLinnea Gräf <nea@nea.moe>2024-06-14 18:34:40 +0200
commite4bd69a0569b4ccc49b9e4b89998220bf4bfe25a (patch)
tree2cb89c55c9c63cbb115cfeaff1848f301c9a461c /src/main/kotlin/moe/nea/firmament/gui
parentcd1826a49822e7be0fb583e7b540270560fb657d (diff)
downloadFirmament-e4bd69a0569b4ccc49b9e4b89998220bf4bfe25a.tar.gz
Firmament-e4bd69a0569b4ccc49b9e4b89998220bf4bfe25a.tar.bz2
Firmament-e4bd69a0569b4ccc49b9e4b89998220bf4bfe25a.zip
Add shiny pig tracker
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/gui')
-rw-r--r--src/main/kotlin/moe/nea/firmament/gui/BarComponent.kt2
-rw-r--r--src/main/kotlin/moe/nea/firmament/gui/hud/MoulConfigHud.kt5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/gui/BarComponent.kt b/src/main/kotlin/moe/nea/firmament/gui/BarComponent.kt
index a1eb23c..91b5735 100644
--- a/src/main/kotlin/moe/nea/firmament/gui/BarComponent.kt
+++ b/src/main/kotlin/moe/nea/firmament/gui/BarComponent.kt
@@ -58,7 +58,7 @@ class BarComponent(
ScreenDrawing.texturedRect(context, x, y, 4, 8, texture, emptyColor.color)
return
}
- val increasePerPixel = (sectionEnd - sectionStart / 4)
+ val increasePerPixel = (sectionEnd - sectionStart) / width
var valueAtPixel = sectionStart
for (i in (0 until width)) {
ScreenDrawing.texturedRect(
diff --git a/src/main/kotlin/moe/nea/firmament/gui/hud/MoulConfigHud.kt b/src/main/kotlin/moe/nea/firmament/gui/hud/MoulConfigHud.kt
index ec884bb..afc8740 100644
--- a/src/main/kotlin/moe/nea/firmament/gui/hud/MoulConfigHud.kt
+++ b/src/main/kotlin/moe/nea/firmament/gui/hud/MoulConfigHud.kt
@@ -30,11 +30,16 @@ abstract class MoulConfigHud(
private var fragment: GuiContext? = null
+ fun forceInit() {
+
+ }
+
open fun shouldRender(): Boolean {
return true
}
init {
+ require(name.matches("^[a-z_/]+$".toRegex()))
HudRenderEvent.subscribe {
if (!shouldRender()) return@subscribe
val renderContext = componentWrapper.createContext(it.context)