From d58ae049cf25436da4a03dae967b4226cc88808f Mon Sep 17 00:00:00 2001 From: zOnlyKroks Date: Fri, 6 Jan 2023 23:41:03 +0100 Subject: [PATCH] Ingamegui Working --- .../bungeecore/commands/ModCommand.java | 28 +++++++++++-------- .../steamwar/messages/BungeeCore.properties | 3 +- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/ModCommand.java b/src/de/steamwar/bungeecore/commands/ModCommand.java index 3b589ab..d352a3d 100644 --- a/src/de/steamwar/bungeecore/commands/ModCommand.java +++ b/src/de/steamwar/bungeecore/commands/ModCommand.java @@ -23,7 +23,7 @@ public class ModCommand extends SWCommand { private static final Statement get = new Statement("SELECT * FROM Mods WHERE ModName = ? AND Platform = ?"); - private static final Statement getAll = new Statement("SELECT * FROM Mods WHERE ModType = 0 ORDER BY ModName DESC LIMIT ?, ?"); + private static final Statement getAll = new Statement("SELECT * FROM Mods ORDER BY ModName DESC LIMIT ?, ?"); public ModCommand() { super("mod", "bungeecore.softreload", "mods"); @@ -31,22 +31,26 @@ public class ModCommand extends SWCommand { @Register(value = "a") public void genericCommand(ProxiedPlayer p) { - new SWStreamInv<>(p,Message.parse("MOD_COMMAND_GUI_TITLE",p), (click, element) -> { - SWInventory swInventory = new SWInventory(p,5,"Mod Changer"); + SWStreamInv swStreamInv = new SWStreamInv<>(p,Message.parse("MOD_COMMAND_GUI_TITLE",p), (click, element) -> { + openGradingWindow(p,element); + },page -> getMods(page,45).stream().map(mod -> new SWListInv.SWListEntry<>(getModItem(mod),mod)).collect(Collectors.toList())); - String modName = element.modName; - int modPlatform = element.platform.get(); + swStreamInv.open(); + } - swInventory.addItem(0,new SWItem("GRAY_CONCRETE","Unclassified"), (click1 -> set.update(0,modName,modPlatform))); + private void openGradingWindow(ProxiedPlayer p,ModEntry element) { + SWInventory swInventory = new SWInventory(p,9,Message.parse("MOD_COMMAND_GUI",p)); - swInventory.addItem(1,new SWItem("GREEN_CONCRETE", "Allowed"), (click1 -> set.update(1,modName,modPlatform))); - swInventory.addItem(2,new SWItem("YELLOW_CONCRETE", "Pending"),(click1 -> set.update(2,modName,modPlatform))); - swInventory.addItem(3,new SWItem("RED_CONCRETE","Forbidden"),(click1 -> set.update(3,modName,modPlatform))); - swInventory.addItem(4,new SWItem("PURPLE_CONCRETE", "YT_only"),(click1 -> set.update(4,modName,modPlatform))); + String modName = element.modName; + int modPlatform = element.platform.get(); - swInventory.open(); + swInventory.addItem(2,new SWItem("GRAY_CONCRETE","Unclassified"), (click1 -> set.update(0,modName,modPlatform))); + swInventory.addItem(3,new SWItem("GREEN_CONCRETE", "Allowed"), (click1 -> set.update(1,modName,modPlatform))); + swInventory.addItem(4,new SWItem("YELLOW_CONCRETE", "Pending"),(click1 -> set.update(2,modName,modPlatform))); + swInventory.addItem(5,new SWItem("RED_CONCRETE","Forbidden"),(click1 -> set.update(3,modName,modPlatform))); + swInventory.addItem(6,new SWItem("PURPLE_CONCRETE", "YT_only"),(click1 -> set.update(4,modName,modPlatform))); - },page -> getMods(page,45).stream().map(mod -> new SWListInv.SWListEntry<>(getModItem(mod),mod)).collect(Collectors.toList())).open(); + swInventory.open(); } private SWItem getModItem(ModEntry modEntry) { diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index d1d2b8a..8b16b70 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -665,4 +665,5 @@ MOD_NO_MORE_UNCLASSIFIED_MODS=§7No more unclassified mods found in databank! MOD_FOUND_NEXT_MOD=§7Next unclassified mod is {0}! MOD_COMMAND_NOT_FOUND_IN_DATABASE=§7The Mod {0} on platform {1} was§c not §7found in the database! MOD_COMMAND_INFO=§7The mod {0} on platform {1} is of the type {2}. -MOD_COMMAND_GUI_TITLE="§7Unclassified Mods" \ No newline at end of file +MOD_COMMAND_GUI_TITLE=§7Unclassified Mods +MOD_COMMAND_GUI=§7Mod Type Changer \ No newline at end of file