Add confirmation menu to apply kits button
This commit is contained in:
parent
56122d0b9b
commit
09cc258d9b
@ -6,10 +6,14 @@ import java.util.function.Supplier;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
|
||||
import mineplex.core.account.CoreClient;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.itemstack.ItemBuilder;
|
||||
import mineplex.core.shop.confirmation.ConfirmationCallback;
|
||||
import mineplex.core.shop.confirmation.ConfirmationPage;
|
||||
import mineplex.core.shop.confirmation.ConfirmationProcessor;
|
||||
import mineplex.core.shop.item.ShopItem;
|
||||
import mineplex.staffServer.customerSupport.CustomerSupport;
|
||||
import mineplex.staffServer.ui.chest.SupportChestPage;
|
||||
@ -91,8 +95,8 @@ public class SupportHomePage extends SupportPage
|
||||
}, 1, false, true), SupportChestPage.class);
|
||||
|
||||
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()
|
||||
C.mBody + "Click to view gems or",
|
||||
C.mBody + "shard packages for " + C.cYellow + _target.getName()
|
||||
}, 1, false, true), SupportCurrencyPage.class);
|
||||
|
||||
buildPageButton(getSlotIndex(1, 6), new ShopItem(Material.GOLD_INGOT, "PowerPlay Club", new String[] {
|
||||
@ -106,25 +110,25 @@ public class SupportHomePage extends SupportPage
|
||||
}, 1, false, true), SupportRankBonusPage.class, () -> getShop().getBonusLog().get(_target.getAccountId()) != null);
|
||||
|
||||
buildPageButton(getSlotIndex(3, 4), new ShopItem(Material.BOOK_AND_QUILL, "Rank Utilities", new String[] {
|
||||
C.mBody + "Click to apply ranks",
|
||||
C.mBody + "Click to view ranks",
|
||||
C.mBody + "and monthly bonus",
|
||||
C.mBody +"items to " + C.cYellow + _target.getName()
|
||||
C.mBody + "items for " + C.cYellow + _target.getName()
|
||||
}, 1, false, true), SupportRankListPage.class);
|
||||
|
||||
buildPageButton(getSlotIndex(3, 6), new ShopItem(Material.BONE, "Pets", new String[] {
|
||||
C.mBody + "Click to give pets",
|
||||
C.mBody + "to " + C.cYellow + _target.getName()
|
||||
C.mBody + "Click to view pets",
|
||||
C.mBody + "for " + C.cYellow + _target.getName()
|
||||
}, 1, false, true), SupportPetPage.class);
|
||||
|
||||
buildPageButton(getSlotIndex(5, 2), new ShopItem(Material.HAY_BLOCK, "Misc Packages", new String[] {
|
||||
C.mBody + "Click to give misc",
|
||||
C.mBody + "Click to view misc",
|
||||
C.mBody + "packages, such as",
|
||||
C.mBody + "Frost Lord and",
|
||||
C.mBody + "rainbow bundle."
|
||||
}, 1, false, true), SupportMiscPackagePage.class);
|
||||
|
||||
buildPageButton(getSlotIndex(5, 4), new ShopItem(Material.IRON_SWORD, "Clans Packages", new String[] {
|
||||
C.mBody + "Click to give clans",
|
||||
C.mBody + "Click to view clans",
|
||||
C.mBody + "packages, such as",
|
||||
C.mBody + "Boss Tokens and",
|
||||
C.mBody + "Supply Drops."
|
||||
@ -137,11 +141,29 @@ public class SupportHomePage extends SupportPage
|
||||
.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();
|
||||
}
|
||||
getShop().openPageForPlayer(getPlayer(), new ConfirmationPage<>(
|
||||
getPlayer(),
|
||||
this,
|
||||
new ConfirmationProcessor()
|
||||
{
|
||||
@Override
|
||||
public void init(Inventory inventory)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ConfirmationCallback callback)
|
||||
{
|
||||
getPlugin().getDonationManager().applyKits(_target.getName());
|
||||
message("You gave all kits to " + C.cYellow + _target.getName());
|
||||
playSuccess();
|
||||
}
|
||||
},
|
||||
new ItemBuilder(Material.WOOD_DOOR)
|
||||
.setTitle(C.cGreenB + "Confirm Apply All Kits")
|
||||
.build()
|
||||
))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user