Hide SnowyGUI HUD on F1

Signed-off-by: Username404-59 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404-59 2026-02-21 02:29:51 +01:00
parent e86b7e92fe
commit 6b113b7750
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1

View File

@ -3,11 +3,16 @@ package fr.username404.snowygui.gui.feature
import fr.username404.snowygui.EventSnowy
import fr.username404.snowygui.argsLambda
import fr.username404.snowygui.gui.Renderable
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiGraphics
sealed class ButtonImplWithHud: ButtonImpl() {
protected abstract val hudRenderLambda: Renderable
private val generatedLambda: argsLambda = { hudRenderLambda.render(it.first() as GuiGraphics?) }
private val generatedLambda: argsLambda = {
if (!Minecraft.getInstance().options.hideGui) {
hudRenderLambda.render(it.first() as GuiGraphics?)
}
}
final override fun execAction() {
EventSnowy["HudRender"].run {
if (toggled) add(generatedLambda)