From 1094cf997ebfe3b9b6982dfbb116e67dca096396 Mon Sep 17 00:00:00 2001 From: Spencer Date: Sat, 6 Jan 2018 15:35:53 -0500 Subject: [PATCH] Make buttons a 3x3 grid instead of a weird pyramid --- .../staffServer/ui/SupportHomePage.java | 42 ++++++++++++------- .../ui/packages/SupportClansPackagePage.java | 1 - 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportHomePage.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportHomePage.java index cca88e36d..88f71a093 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportHomePage.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportHomePage.java @@ -9,13 +9,13 @@ import org.bukkit.entity.Player; import mineplex.core.account.CoreClient; import mineplex.core.common.util.C; +import mineplex.core.itemstack.ItemBuilder; import mineplex.core.shop.item.ShopItem; import mineplex.staffServer.customerSupport.CustomerSupport; import mineplex.staffServer.ui.chest.SupportChestPage; import mineplex.staffServer.ui.currency.SupportCurrencyPage; import mineplex.staffServer.ui.packages.SupportClansPackagePage; import mineplex.staffServer.ui.packages.SupportOneTimePackagePage; -import mineplex.staffServer.ui.packages.SupportPackagePage; import mineplex.staffServer.ui.pet.SupportPetPage; import mineplex.staffServer.ui.ppc.SupportPowerplayPage; import mineplex.staffServer.ui.rank.SupportRankBonusPage; @@ -41,7 +41,7 @@ public class SupportHomePage extends SupportPage }, 1, true, true)); } - private void buildPageButton(int slot,ShopItem shopItem, Class clazz) + private void buildPageButton(int slot, ShopItem shopItem, Class clazz) { Constructor pageConstructor; try @@ -85,49 +85,63 @@ public class SupportHomePage extends SupportPage { super.buildPage(); - buildPageButton(getSlotIndex(1, 1), new ShopItem(Material.CHEST, "Chests", new String[] { + buildPageButton(getSlotIndex(1, 2), new ShopItem(Material.CHEST, "Chests", new String[] { C.mBody + "Click to view or add", C.mBody + "chests for " + C.cYellow + _target.getName() }, 1, false, true), SupportChestPage.class); - buildPageButton(getSlotIndex(1, 3), new ShopItem(Material.EMERALD, "Currency", new String[] { + buildPageButton(getSlotIndex(1, 4), new ShopItem(Material.EMERALD, "Currency", new String[] { C.mBody + "Click to add gems or", C.mBody + "shards for " + C.cYellow + _target.getName() }, 1, false, true), SupportCurrencyPage.class); - buildPageButton(getSlotIndex(1, 5), new ShopItem(Material.ENCHANTED_BOOK, "Rank Bonus", new String[] { - C.mBody + "Click to view rank", - C.mBody + "bonus log for " + C.cYellow + _target.getName() - }, 1, false, true), SupportRankBonusPage.class, () -> getShop().getBonusLog().get(_target.getAccountId()) != null); - - buildPageButton(getSlotIndex(1, 7), new ShopItem(Material.GOLD_INGOT, "PowerPlay Club", new String[] { + buildPageButton(getSlotIndex(1, 6), new ShopItem(Material.GOLD_INGOT, "PowerPlay Club", new String[] { C.mBody + "Click to view PowerPlay", C.mBody + "club info for " + C.cYellow + _target.getName() }, 1, false, true), SupportPowerplayPage.class, () -> getShop().getPowerPlayData().get(_target.getAccountId()) != null); - buildPageButton(getSlotIndex(2, 2), new ShopItem(Material.BOOK_AND_QUILL, "Rank Utilities", new String[] { + buildPageButton(getSlotIndex(2, 2), new ShopItem(Material.ENCHANTED_BOOK, "Rank Bonus", new String[] { + C.mBody + "Click to view rank", + C.mBody + "bonus log for " + C.cYellow + _target.getName() + }, 1, false, true), SupportRankBonusPage.class, () -> getShop().getBonusLog().get(_target.getAccountId()) != null); + + buildPageButton(getSlotIndex(2, 4), new ShopItem(Material.BOOK_AND_QUILL, "Rank Utilities", new String[] { C.mBody + "Click to apply ranks", C.mBody + "and monthly bonus", C.mBody +"items to " + C.cYellow + _target.getName() }, 1, false, true), SupportRankListPage.class); - buildPageButton(getSlotIndex(2, 4), new ShopItem(Material.BONE, "Pets", new String[] { + buildPageButton(getSlotIndex(2, 6), new ShopItem(Material.BONE, "Pets", new String[] { C.mBody + "Click to give pets", C.mBody + "to " + C.cYellow + _target.getName() }, 1, false, true), SupportPetPage.class); - buildPageButton(getSlotIndex(2, 6), new ShopItem(Material.HAY_BLOCK, "One-Time Packages", new String[] { + buildPageButton(getSlotIndex(3, 2), new ShopItem(Material.HAY_BLOCK, "One-Time Packages", new String[] { C.mBody + "Click to give one", C.mBody + "time packages, such", C.mBody + "as Frost Lord and", C.mBody + "rainbow bundle." }, 1, false, true), SupportOneTimePackagePage.class); - buildPageButton(getSlotIndex(3, 1), new ShopItem(Material.IRON_SWORD, "Clans Packages", new String[] { + buildPageButton(getSlotIndex(3, 4), new ShopItem(Material.IRON_SWORD, "Clans Packages", new String[] { C.mBody + "Click to give clans", C.mBody + "packages, such as", C.mBody + "Boss Tokens and", C.mBody + "Supply Drops." }, 1, false, true), SupportClansPackagePage.class); + + addButton(getSlotIndex(3, 6), + new ItemBuilder(Material.WOOD_DOOR) + .setTitle(C.cGreenB + "Apply Kits") + .addLore(C.mBody + "Click to apply all") + .addLore(C.mBody + "kits to " + C.cYellow + _target.getName()) + .build(), + (p, c) -> + { + getPlugin().getDonationManager().applyKits(_target.getName()); + message("You gave all kits to " + C.cYellow + _target.getName()); + playSuccess(); + } + ); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/packages/SupportClansPackagePage.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/packages/SupportClansPackagePage.java index f03f2e292..68f4d7514 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/packages/SupportClansPackagePage.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/packages/SupportClansPackagePage.java @@ -2,7 +2,6 @@ package mineplex.staffServer.ui.packages; import java.util.ArrayList; import java.util.Arrays; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.stream.Collectors;