Remove old GameModifierPages
This commit is contained in:
parent
4f6d24dea8
commit
67291804bf
@ -1,68 +0,0 @@
|
||||
package mineplex.core.cosmetic.ui.page.gamemodifiers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.cosmetic.CosmeticManager;
|
||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||
import mineplex.core.cosmetic.ui.page.Menu;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.GameModifierType;
|
||||
import mineplex.core.gadget.types.GameModifierGadget;
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.core.shop.item.ShopItem;
|
||||
|
||||
public class GameModifierPage extends GadgetPage
|
||||
{
|
||||
|
||||
public GameModifierPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, Player player)
|
||||
{
|
||||
super(plugin, shop, clientManager, donationManager, "Game Cosmetics", player);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
int slot = 10;
|
||||
|
||||
for (GameModifierType type : GameModifierType.values())
|
||||
{
|
||||
int own = 0;
|
||||
int total = 0;
|
||||
for(GameModifierGadget g : getPlugin().getGadgetManager().getGameModifiers(type)) {
|
||||
if(g.ownsGadget(getPlayer())) own++;
|
||||
total++;
|
||||
}
|
||||
if (total == 0)
|
||||
continue;
|
||||
ItemStack item = type.getItemStack();
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
|
||||
List<String> lore = meta.getLore();
|
||||
lore.add(0, " ");
|
||||
lore.add(" ");
|
||||
lore.add(C.cWhite + "You own " + own + "/" + total);
|
||||
lore.add(" ");
|
||||
lore.add(C.cGreen + "Left-click to view Sub-Category");
|
||||
|
||||
meta.setLore(lore);
|
||||
item.setItemMeta(meta);
|
||||
|
||||
addButton(slot, item, (player, clickType) -> getShop().openPageForPlayer(player, new GameModifierSubPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), type.getName(), player, type)));
|
||||
|
||||
slot++;
|
||||
if(slot%9 == 8) slot += 2;
|
||||
}
|
||||
|
||||
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), (player, clickType) -> getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player)));
|
||||
}
|
||||
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
package mineplex.core.cosmetic.ui.page.gamemodifiers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.cosmetic.CosmeticManager;
|
||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.GameModifierType;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType;
|
||||
import mineplex.core.gadget.types.GameModifierGadget;
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.core.shop.item.ShopItem;
|
||||
|
||||
public class GameModifierSubPage extends GadgetPage
|
||||
{
|
||||
|
||||
private final GameModifierType _type;
|
||||
|
||||
public GameModifierSubPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager,
|
||||
String name, Player player, GameModifierType gameType)
|
||||
{
|
||||
super(plugin, shop, clientManager, donationManager, name, player);
|
||||
_type = gameType;
|
||||
buildPage();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
if(_type == null) return;
|
||||
|
||||
int slot = 10;
|
||||
|
||||
if (_type.hasKits())
|
||||
{
|
||||
for (KitModifierType kitModifierType : KitModifierType.values())
|
||||
{
|
||||
if (kitModifierType.getGameModifierType().equals(_type))
|
||||
{
|
||||
int own = 0;
|
||||
int total = 0;
|
||||
for (GameModifierGadget g : getPlugin().getGadgetManager().getGameModifiers(kitModifierType))
|
||||
{
|
||||
if (g.ownsGadget(getPlayer())) own++;
|
||||
total++;
|
||||
}
|
||||
|
||||
ItemStack itemStack = kitModifierType.getItemStack();
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
|
||||
List<String> lore = itemMeta.getLore();
|
||||
lore.add(0, " ");
|
||||
lore.add(" ");
|
||||
lore.add(C.cWhite + "You own " + own + "/" + total);
|
||||
lore.add(" ");
|
||||
lore.add(C.cGreen + "Left-click to view Kit Modifiers");
|
||||
|
||||
itemMeta.setLore(lore);
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
|
||||
addButton(slot, itemStack, (player, clickType) -> getShop().openPageForPlayer(player, new KitGameModifierPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), kitModifierType.getKitName(), player, _type, kitModifierType)));
|
||||
|
||||
slot++;
|
||||
|
||||
if(slot % 9 == 8) slot += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (GameModifierGadget gadget : getPlugin().getGadgetManager().getGameModifiers(_type))
|
||||
{
|
||||
|
||||
addGadget(gadget, slot);
|
||||
|
||||
if (gadget.isActive(getPlayer()))
|
||||
addGlow(slot);
|
||||
|
||||
slot++;
|
||||
|
||||
if(slot%9 == 8) slot += 2;
|
||||
}
|
||||
}
|
||||
|
||||
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), (player, clickType) -> getShop().openPageForPlayer(getPlayer(), new GameModifierPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), player)));
|
||||
}
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
package mineplex.core.cosmetic.ui.page.gamemodifiers;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.cosmetic.CosmeticManager;
|
||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.GameModifierType;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitGameModifier;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType;
|
||||
import mineplex.core.gadget.types.GameModifierGadget;
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.core.shop.item.ShopItem;
|
||||
|
||||
public class KitGameModifierPage extends GadgetPage
|
||||
{
|
||||
|
||||
private final GameModifierType _type;
|
||||
private final KitModifierType _kitType;
|
||||
|
||||
public KitGameModifierPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager,
|
||||
String name, Player player, GameModifierType gameType, KitModifierType kitType)
|
||||
{
|
||||
super(plugin, shop, clientManager, donationManager, name, player);
|
||||
_type = gameType;
|
||||
_kitType = kitType;
|
||||
buildPage();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
if(_type == null) return;
|
||||
|
||||
int slot = 10;
|
||||
|
||||
for (GameModifierGadget gadget : getPlugin().getGadgetManager().getGameModifiers(_kitType))
|
||||
{
|
||||
if (gadget instanceof KitGameModifier)
|
||||
{
|
||||
KitGameModifier kitGameModifier = (KitGameModifier) gadget;
|
||||
if (kitGameModifier.getKitType().equals(_kitType))
|
||||
{
|
||||
addGadget(gadget, slot);
|
||||
|
||||
if (gadget.isActive(getPlayer()))
|
||||
addGlow(slot);
|
||||
|
||||
slot++;
|
||||
|
||||
if(slot % 9 == 8) slot += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()
|
||||
{
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
getShop().openPageForPlayer(getPlayer(), new GameModifierSubPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "Game Modifiers", player, _type));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user