Kit selector, not rank selector...

This commit is contained in:
LCastr0 2017-04-26 14:10:49 -03:00
parent 1855cfc4ed
commit 01076ec054
6 changed files with 40 additions and 32 deletions

View File

@ -0,0 +1,21 @@
package mineplex.core.cosmetic.ui.button.open;
import org.bukkit.entity.Player;
import mineplex.core.cosmetic.ui.page.Menu;
import mineplex.core.cosmetic.ui.page.KitSelectorPage;
import mineplex.core.gadget.types.Gadget;
public class OpenKitSelector extends OpenPageButton
{
public OpenKitSelector(Menu menu, Gadget active)
{
super(menu, active);
}
@Override
protected void leftClick(Player player)
{
getMenu().getShop().openPageForPlayer(player, new KitSelectorPage(getMenu().getPlugin(), getMenu().getShop(), getMenu().getClientManager(), getMenu().getDonationManager(), "Rank Selector Particles", player));
}
}

View File

@ -1,21 +0,0 @@
package mineplex.core.cosmetic.ui.button.open;
import org.bukkit.entity.Player;
import mineplex.core.cosmetic.ui.page.Menu;
import mineplex.core.cosmetic.ui.page.RankSelectorPage;
import mineplex.core.gadget.types.Gadget;
public class OpenRankSelector extends OpenPageButton
{
public OpenRankSelector(Menu menu, Gadget active)
{
super(menu, active);
}
@Override
protected void leftClick(Player player)
{
getMenu().getShop().openPageForPlayer(player, new RankSelectorPage(getMenu().getPlugin(), getMenu().getShop(), getMenu().getClientManager(), getMenu().getDonationManager(), "Rank Selector Particles", player));
}
}

View File

@ -14,9 +14,9 @@ import mineplex.core.gadget.types.GadgetType;
import mineplex.core.shop.item.IButton;
import mineplex.core.shop.item.ShopItem;
public class RankSelectorPage extends GadgetPage
public class KitSelectorPage extends GadgetPage
{
public RankSelectorPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
public KitSelectorPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
{
super(plugin, shop, clientManager, donationManager, name, player);
}
@ -26,11 +26,11 @@ public class RankSelectorPage extends GadgetPage
{
int slot = 10;
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.RANK_SELECTOR))
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.KIT_SELECTOR))
{
addGadget(gadget, slot);
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.RANK_SELECTOR) == gadget)
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.KIT_SELECTOR) == gadget)
addGlow(slot);
slot++;

View File

@ -30,7 +30,7 @@ import mineplex.core.cosmetic.ui.button.open.OpenMounts;
import mineplex.core.cosmetic.ui.button.open.OpenMusic;
import mineplex.core.cosmetic.ui.button.open.OpenParticles;
import mineplex.core.cosmetic.ui.button.open.OpenPets;
import mineplex.core.cosmetic.ui.button.open.OpenRankSelector;
import mineplex.core.cosmetic.ui.button.open.OpenKitSelector;
import mineplex.core.cosmetic.ui.button.open.OpenTaunts;
import mineplex.core.cosmetic.ui.button.open.OpenWinEffect;
import mineplex.core.donation.DonationManager;
@ -90,9 +90,9 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
mountSlot = slots[6], petSlot = slots[7], hatSlot = slots[8],
costumeSlot = slots[9], musicSlot = slots[10], tauntSlot = slots[11],
winEffectSlot = slots[12], gameModifierSlot = slots[13], balloonsSlot = slots[14],
rankSelectorSlot = balloonsSlot + 4;
kitSelectorSlot = balloonsSlot + 4;
addItem(rankSelectorSlot + 2, shards);
addItem(kitSelectorSlot + 2, shards);
EnumMap<GadgetType, Integer> ownedCount = new EnumMap<>(GadgetType.class);
EnumMap<GadgetType, Integer> maxCount = new EnumMap<>(GadgetType.class);
@ -223,10 +223,10 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
addButton(balloonsSlot, new ShopItem(Material.LEASH, "Balloons", lore, 1, false), new OpenBalloons(this, enabled.get(type)));
if (enabled.containsKey(type)) addGlow(balloonsSlot);
type = GadgetType.RANK_SELECTOR;
type = GadgetType.KIT_SELECTOR;
lore = getLore(ownedCount.get(type), maxCount.get(type), "Placeholder", VISIBILITY_GAME_HUB, enabled.get(type));
addButton(rankSelectorSlot, new ShopItem(Material.LEVER, "Rank Selector Particles", lore, 1, false), new OpenRankSelector(this, enabled.get(type)));
if (enabled.containsKey(type)) addGlow(rankSelectorSlot);
addButton(kitSelectorSlot, new ShopItem(Material.LEVER, "Kit Selector Particles", lore, 1, false), new OpenKitSelector(this, enabled.get(type)));
if (enabled.containsKey(type)) addGlow(kitSelectorSlot);
}
private String[] getLore(int ownedCount, int maxCount, String info, String visibility, Gadget enabled)

View File

@ -18,7 +18,7 @@ public enum GadgetType
WIN_EFFECT("Win Effects", "activeWinEffect"),
GAME_MODIFIER("Game Modifiers", ""),
BALLOON("Balloons", ""),
RANK_SELECTOR("Rank Selectors", "activeRankSelector");
KIT_SELECTOR("Kit Selectors", "activeKitSelector");
private String _name;
private String _databaseKey;

View File

@ -0,0 +1,8 @@
package mineplex.core.gadget.types;
/**
* Handles custom particle effects for the arcade hub kit selectors
*/
public class KitSelectorGadget
{
}