Make buttons a 3x3 grid instead of a weird pyramid

This commit is contained in:
Spencer 2018-01-06 15:35:53 -05:00 committed by Alexander Meech
parent 41e49e3649
commit 1094cf997e
2 changed files with 28 additions and 15 deletions

View File

@ -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;
@ -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();
}
);
}
}

View File

@ -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;