Hide SnowyGUI HUD on F1
Signed-off-by: Username404-59 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
e86b7e92fe
commit
6b113b7750
@ -3,11 +3,16 @@ package fr.username404.snowygui.gui.feature
|
|||||||
import fr.username404.snowygui.EventSnowy
|
import fr.username404.snowygui.EventSnowy
|
||||||
import fr.username404.snowygui.argsLambda
|
import fr.username404.snowygui.argsLambda
|
||||||
import fr.username404.snowygui.gui.Renderable
|
import fr.username404.snowygui.gui.Renderable
|
||||||
|
import net.minecraft.client.Minecraft
|
||||||
import net.minecraft.client.gui.GuiGraphics
|
import net.minecraft.client.gui.GuiGraphics
|
||||||
|
|
||||||
sealed class ButtonImplWithHud: ButtonImpl() {
|
sealed class ButtonImplWithHud: ButtonImpl() {
|
||||||
protected abstract val hudRenderLambda: Renderable
|
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() {
|
final override fun execAction() {
|
||||||
EventSnowy["HudRender"].run {
|
EventSnowy["HudRender"].run {
|
||||||
if (toggled) add(generatedLambda)
|
if (toggled) add(generatedLambda)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user