mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-25 02:54:27 +00:00
Added closeOnEsc variable to ICustomGui
This commit is contained in:
1 parent
37e93df24a
commit
bce3b2f5ea
2 files changed
+38
-36
No files matched your search
@@ -75,6 +75,8 @@ public class GuiCustom extends GuiScreen implements ICustomScrollListener, IGuiD
|
||||
private boolean field_146993_M;
|
||||
private ItemStack field_146994_N;
|
||||
|
||||
public boolean closeOnEsc = true;
|
||||
|
||||
public GuiCustom(ContainerCustomGui container) {
|
||||
this.inventorySlots = container;
|
||||
this.field_146995_H = true;
|
||||
@@ -508,7 +510,7 @@ public class GuiCustom extends GuiScreen implements ICustomScrollListener, IGuiD
|
||||
}
|
||||
|
||||
protected void keyTyped(char typedChar, int keyCode) {
|
||||
if (keyCode == 1)
|
||||
if (keyCode == 1 && closeOnEsc)
|
||||
{
|
||||
this.mc.thePlayer.closeScreen();
|
||||
}
|
||||
@@ -654,6 +656,7 @@ public class GuiCustom extends GuiScreen implements ICustomScrollListener, IGuiD
|
||||
this.gui = gui;
|
||||
this.xSize = gui.getWidth();
|
||||
this.ySize = gui.getHeight();
|
||||
this.closeOnEsc = gui.doesCloseOnEscape();
|
||||
if (!gui.getBackgroundTexture().isEmpty()) {
|
||||
this.background = new ResourceLocation(gui.getBackgroundTexture());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user