From 7afe6d73c81ae17e5a3e8a6d77e01d47081eb3d2 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 29 Oct 2022 13:20:25 +0200 Subject: [PATCH] Make Outside-Click do Updir --- .../src/de/steamwar/schematicsystem/commands/GUI.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java index 2984f9d..35c771c 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java @@ -46,6 +46,13 @@ public class GUI { @Override public void onListRender(SchematicSelector selector, SWListInv inv, SchematicNode parent) { + inv.setCallback(-999, (ClickType click) -> { + if(parent == null) { + player.closeInventory(); + } else { + selector.reOpenDirUp(); + } + }); if(parent == null) { inv.setItem(49, Material.AIR, "", clickType -> {}); } else { @@ -187,7 +194,7 @@ public class GUI { } } - inv.setCallback(-999, click -> player.closeInventory()); + inv.setCallback(-999, click -> back.reOpen()); inv.open(); }