Skip to content

Commit ba7e004

Browse files
authored
[InfoHud] Fix gui being openable everywhere (#239)
Found by ACatThatCanParkourReallyWell9900, Thanks!
2 parents 3fd12f1 + adc28a0 commit ba7e004

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/main/java/com/minecrafttas/tasmod/gui/InfoHud.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,5 +587,4 @@ private int getBBRight(int x, String text) {
587587
private int getBBDown(int y) {
588588
return y + 14;
589589
}
590-
591590
}

src/main/java/com/minecrafttas/tasmod/registries/TASmodKeybinds.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ public enum TASmodKeybinds {
3030
e.printStackTrace();
3131
}
3232
}),
33-
INFO_GUI("Open InfoGui Editor", "TASmod", Keyboard.KEY_F6, () -> Minecraft.getMinecraft().displayGuiScreen(TASmodClient.hud)),
33+
INFO_GUI("Open InfoGui Editor", "TASmod", Keyboard.KEY_F6, () -> {
34+
Minecraft mc = Minecraft.getMinecraft();
35+
if (mc.currentScreen == null) {
36+
mc.displayGuiScreen(TASmodClient.hud);
37+
}
38+
}),
3439
TEST1("Various Testing", "TASmod", Keyboard.KEY_F12, () -> {
3540
}, VirtualKeybindings::isKeyDown),
3641
TEST2("Various Testing2", "TASmod", Keyboard.KEY_F7, () -> {

0 commit comments

Comments
 (0)