From 6b113b7750bdfe3f97d1267f8be73cd4fe1d50ff Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Sat, 21 Feb 2026 02:29:51 +0100 Subject: [PATCH] Hide SnowyGUI HUD on F1 Signed-off-by: Username404-59 --- .../username404/snowygui/gui/feature/ButtonImplWithHud.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImplWithHud.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImplWithHud.kt index 6387776..44c7ddb 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImplWithHud.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImplWithHud.kt @@ -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)