diff options
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/gui')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/gui/BarComponent.kt | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/gui/hud/MoulConfigHud.kt | 5 |
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) |