From b0703c393b74f07d05c7451b95e91aee46a40c39 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Wed, 26 Oct 2022 11:41:45 +0200 Subject: [PATCH 1/3] Add Quick item change --- .../src/de/steamwar/schematicsystem/commands/GUI.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java index f2874c0..fff279b 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java @@ -78,8 +78,13 @@ public class GUI { } Material mat = SWItem.getMaterial(node.getItem()); - inv.setItem(node.isDir()?7:5, mat, SchematicSystem.MESSAGE.parse("GUI_INFO_MAT", player, mat.name()), Arrays.asList(SchematicSystem.MESSAGE.parse("CHANGE", player), SchematicSystem.MESSAGE.parse("CLICK", player)), false, click -> { - changeItem(player, node, back); + inv.setItemEvent(node.isDir()?7:5, mat, SchematicSystem.MESSAGE.parse("GUI_INFO_MAT", player, mat.name()), Arrays.asList(SchematicSystem.MESSAGE.parse("CHANGE", player), SchematicSystem.MESSAGE.parse("CLICK", player)), false, event -> { + if(event.getCursor() != null && event.getCursor().getType() != Material.AIR) { + node.setItem(event.getCursor().getType().name()); + info(player, node, back); + } else { + changeItem(player, node, back); + } }); if(!node.isDir()) { inv.setItem(6, node.getSchemtype().getMaterial(), SchematicSystem.MESSAGE.parse("GUI_INFO_TYPE", player, node.getSchemtype().name()), Arrays.asList(SchematicSystem.MESSAGE.parse("CHANGE", player), SchematicSystem.MESSAGE.parse("CLICK", player)), node.getSchemtype().fightType(), click -> { -- 2.39.5 From 1a8c5a0677239d46c499170f6d75c4b20f68cd97 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Wed, 26 Oct 2022 11:47:37 +0200 Subject: [PATCH 2/3] Update Message --- SchematicSystem_Core/src/SchematicSystem.properties | 1 + SchematicSystem_Core/src/SchematicSystem_de.properties | 1 + .../src/de/steamwar/schematicsystem/commands/GUI.java | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/SchematicSystem_Core/src/SchematicSystem.properties b/SchematicSystem_Core/src/SchematicSystem.properties index a792efe..cd6b666 100644 --- a/SchematicSystem_Core/src/SchematicSystem.properties +++ b/SchematicSystem_Core/src/SchematicSystem.properties @@ -3,6 +3,7 @@ ON=§aon OFF=§coff CHANGE=§7To change CLICK=§7Click +CLICK_DRAG_ITEM=§7Click or drag item here CURRENT=§7Current: {0} CONFIRM=§aConfirm CANCEL=§cCancel diff --git a/SchematicSystem_Core/src/SchematicSystem_de.properties b/SchematicSystem_Core/src/SchematicSystem_de.properties index 107636f..9e5bc1e 100644 --- a/SchematicSystem_Core/src/SchematicSystem_de.properties +++ b/SchematicSystem_Core/src/SchematicSystem_de.properties @@ -2,6 +2,7 @@ ON=§aAn OFF=§cAus CHANGE=§7Zum Ändern CLICK=§7anklicken +CLICK_DRAG_ITEM=§7anklicken oder hier hineinlegen CURRENT=§7Aktuell: {0} CONFIRM=§aBestätigen CANCEL=§cAbbrechen diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java index fff279b..4470dbc 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java @@ -78,7 +78,7 @@ public class GUI { } Material mat = SWItem.getMaterial(node.getItem()); - inv.setItemEvent(node.isDir()?7:5, mat, SchematicSystem.MESSAGE.parse("GUI_INFO_MAT", player, mat.name()), Arrays.asList(SchematicSystem.MESSAGE.parse("CHANGE", player), SchematicSystem.MESSAGE.parse("CLICK", player)), false, event -> { + inv.setItemEvent(node.isDir()?7:5, mat, SchematicSystem.MESSAGE.parse("GUI_INFO_MAT", player, mat.name()), Arrays.asList(SchematicSystem.MESSAGE.parse("CHANGE", player), SchematicSystem.MESSAGE.parse("CLICK_DRAG_ITEM", player)), false, event -> { if(event.getCursor() != null && event.getCursor().getType() != Material.AIR) { node.setItem(event.getCursor().getType().name()); info(player, node, back); -- 2.39.5 From a36658faa5d133c5a50359ea8afbe067f7e3e983 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Wed, 26 Oct 2022 11:49:04 +0200 Subject: [PATCH 3/3] Update Message --- SchematicSystem_Core/src/SchematicSystem_de.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SchematicSystem_Core/src/SchematicSystem_de.properties b/SchematicSystem_Core/src/SchematicSystem_de.properties index 9e5bc1e..b45a613 100644 --- a/SchematicSystem_Core/src/SchematicSystem_de.properties +++ b/SchematicSystem_Core/src/SchematicSystem_de.properties @@ -2,7 +2,7 @@ ON=§aAn OFF=§cAus CHANGE=§7Zum Ändern CLICK=§7anklicken -CLICK_DRAG_ITEM=§7anklicken oder hier hineinlegen +CLICK_DRAG_ITEM=§7anklicken oder hier Item hineinlegen CURRENT=§7Aktuell: {0} CONFIRM=§aBestätigen CANCEL=§cAbbrechen -- 2.39.5