From cdbcae7e3e70f253fa824988e92ca370f148003e Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Mon, 14 Dec 2015 00:28:28 -0500 Subject: [PATCH] Cosmetic Menu Update --- .../artifacts/Mineplex_Game_Clans_jar.xml | 2 +- Plugins/.idea/artifacts/Mineplex_Hub_jar.xml | 2 +- .../artifacts/Nautilus_Game_Arcade_jar.xml | 2 +- .../cosmetic/ui/button/OpenArrowTrails.java | 14 +-- .../core/cosmetic/ui/button/OpenCostumes.java | 15 ++-- .../ui/button/OpenDeathAnimations.java | 15 ++-- .../cosmetic/ui/button/OpenDoubleJump.java | 14 +-- .../core/cosmetic/ui/button/OpenGadgets.java | 14 +-- .../core/cosmetic/ui/button/OpenHats.java | 16 ++-- .../core/cosmetic/ui/button/OpenMorphs.java | 19 ++-- .../core/cosmetic/ui/button/OpenMounts.java | 27 ++++-- .../core/cosmetic/ui/button/OpenMusic.java | 17 ++-- .../cosmetic/ui/button/OpenPageButton.java | 48 ++++++++++ .../cosmetic/ui/button/OpenParticles.java | 15 ++-- .../core/cosmetic/ui/button/OpenPets.java | 19 ++-- .../mineplex/core/cosmetic/ui/page/Menu.java | 88 ++++++------------- .../core/treasure/gui/TreasurePage.java | 9 +- 17 files changed, 184 insertions(+), 152 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenPageButton.java diff --git a/Plugins/.idea/artifacts/Mineplex_Game_Clans_jar.xml b/Plugins/.idea/artifacts/Mineplex_Game_Clans_jar.xml index d44ba58ec..cc62eda71 100644 --- a/Plugins/.idea/artifacts/Mineplex_Game_Clans_jar.xml +++ b/Plugins/.idea/artifacts/Mineplex_Game_Clans_jar.xml @@ -20,7 +20,7 @@ - + \ No newline at end of file diff --git a/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml b/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml index 55d803b0b..8ac831c95 100644 --- a/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml +++ b/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml @@ -20,8 +20,8 @@ - + \ No newline at end of file diff --git a/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml b/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml index 619cdf3df..79c3170ce 100644 --- a/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml +++ b/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenArrowTrails.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenArrowTrails.java index 2664fb9c7..e280de6c2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenArrowTrails.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenArrowTrails.java @@ -5,19 +5,19 @@ import org.bukkit.event.inventory.ClickType; import mineplex.core.cosmetic.ui.page.ArrowTrailPage; import mineplex.core.cosmetic.ui.page.Menu; +import mineplex.core.gadget.types.Gadget; import mineplex.core.shop.item.IButton; -public class OpenArrowTrails implements IButton +public class OpenArrowTrails extends OpenPageButton { - private Menu _page; - - public OpenArrowTrails(Menu page) + public OpenArrowTrails(Menu menu, Gadget active) { - _page = page; + super(menu, active); } - public void onClick(Player player, ClickType clickType) + @Override + protected void leftClick(Player player) { - _page.getShop().openPageForPlayer(player, new ArrowTrailPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Arrow Trails", player)); + getMenu().getShop().openPageForPlayer(player, new ArrowTrailPage(getMenu().getPlugin(), getMenu().getShop(), getMenu().getClientManager(), getMenu().getDonationManager(), "Arrow Trails", player)); } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenCostumes.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenCostumes.java index 347a007be..01f528d6e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenCostumes.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenCostumes.java @@ -1,23 +1,20 @@ package mineplex.core.cosmetic.ui.button; import org.bukkit.entity.Player; -import org.bukkit.event.inventory.ClickType; import mineplex.core.cosmetic.ui.page.Menu; -import mineplex.core.shop.item.IButton; +import mineplex.core.gadget.types.Gadget; -public class OpenCostumes implements IButton +public class OpenCostumes extends OpenPageButton { - private Menu _menu; - - public OpenCostumes(Menu menu) + public OpenCostumes(Menu menu, Gadget active) { - _menu = menu; + super(menu, active); } @Override - public void onClick(Player player, ClickType clickType) + protected void leftClick(Player player) { - _menu.openCostumes(player); + getMenu().openCostumes(player); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDeathAnimations.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDeathAnimations.java index fad54be30..f16d51e65 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDeathAnimations.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDeathAnimations.java @@ -5,19 +5,20 @@ import org.bukkit.event.inventory.ClickType; import mineplex.core.cosmetic.ui.page.DeathEffectPage; import mineplex.core.cosmetic.ui.page.Menu; +import mineplex.core.gadget.types.Gadget; import mineplex.core.shop.item.IButton; -public class OpenDeathAnimations implements IButton +public class OpenDeathAnimations extends OpenPageButton { - private Menu _page; - - public OpenDeathAnimations(Menu page) + + public OpenDeathAnimations(Menu menu, Gadget active) { - _page = page; + super(menu, active); } - public void onClick(Player player, ClickType clickType) + @Override + protected void leftClick(Player player) { - _page.getShop().openPageForPlayer(player, new DeathEffectPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Death Animations", player)); + getMenu().getShop().openPageForPlayer(player, new DeathEffectPage(getMenu().getPlugin(), getMenu().getShop(), getMenu().getClientManager(), getMenu().getDonationManager(), "Death Animations", player)); } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDoubleJump.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDoubleJump.java index b433181c8..4506defc4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDoubleJump.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDoubleJump.java @@ -5,19 +5,19 @@ import org.bukkit.event.inventory.ClickType; import mineplex.core.cosmetic.ui.page.DoubleJumpPage; import mineplex.core.cosmetic.ui.page.Menu; +import mineplex.core.gadget.types.Gadget; import mineplex.core.shop.item.IButton; -public class OpenDoubleJump implements IButton +public class OpenDoubleJump extends OpenPageButton { - private Menu _page; - - public OpenDoubleJump(Menu page) + public OpenDoubleJump(Menu menu, Gadget active) { - _page = page; + super(menu, active); } - public void onClick(Player player, ClickType clickType) + @Override + protected void leftClick(Player player) { - _page.getShop().openPageForPlayer(player, new DoubleJumpPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Double Jump Effects", player)); + getMenu().getShop().openPageForPlayer(player, new DoubleJumpPage(getMenu().getPlugin(), getMenu().getShop(), getMenu().getClientManager(), getMenu().getDonationManager(), "Double Jump Effects", player)); } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenGadgets.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenGadgets.java index 79a62a52f..a981afc88 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenGadgets.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenGadgets.java @@ -2,23 +2,23 @@ package mineplex.core.cosmetic.ui.button; import mineplex.core.cosmetic.ui.page.GadgetPage; import mineplex.core.cosmetic.ui.page.Menu; +import mineplex.core.gadget.types.Gadget; import mineplex.core.shop.item.IButton; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; -public class OpenGadgets implements IButton +public class OpenGadgets extends OpenPageButton { - private Menu _page; - - public OpenGadgets(Menu page) + + public OpenGadgets(Menu menu, Gadget active) { - _page = page; + super(menu, active); } @Override - public void onClick(Player player, ClickType clickType) + protected void leftClick(Player player) { - _page.getShop().openPageForPlayer(player, new GadgetPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Gadgets", player)); + getMenu().getShop().openPageForPlayer(player, new GadgetPage(getMenu().getPlugin(), getMenu().getShop(), getMenu().getClientManager(), getMenu().getDonationManager(), "Gadgets", player)); } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenHats.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenHats.java index 48cd8a98c..126382e58 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenHats.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenHats.java @@ -1,23 +1,21 @@ package mineplex.core.cosmetic.ui.button; import org.bukkit.entity.Player; -import org.bukkit.event.inventory.ClickType; import mineplex.core.cosmetic.ui.page.HatPage; import mineplex.core.cosmetic.ui.page.Menu; -import mineplex.core.shop.item.IButton; +import mineplex.core.gadget.types.Gadget; -public class OpenHats implements IButton +public class OpenHats extends OpenPageButton { - private Menu _page; - - public OpenHats(Menu page) + public OpenHats(Menu menu, Gadget active) { - _page = page; + super(menu, active); } - public void onClick(Player player, ClickType clickType) + @Override + protected void leftClick(Player player) { - _page.getShop().openPageForPlayer(player, new HatPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Hats", player)); + getMenu().getShop().openPageForPlayer(player, new HatPage(getMenu().getPlugin(), getMenu().getShop(), getMenu().getClientManager(), getMenu().getDonationManager(), "Hats", player)); } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenMorphs.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenMorphs.java index 8666c1bfb..34d6ac932 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenMorphs.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenMorphs.java @@ -2,22 +2,21 @@ package mineplex.core.cosmetic.ui.button; import mineplex.core.cosmetic.ui.page.Menu; import mineplex.core.cosmetic.ui.page.MorphPage; -import mineplex.core.shop.item.IButton; +import mineplex.core.gadget.types.Gadget; import org.bukkit.entity.Player; -import org.bukkit.event.inventory.ClickType; -public class OpenMorphs implements IButton +public class OpenMorphs extends OpenPageButton { - private Menu _page; - - public OpenMorphs(Menu page) + + public OpenMorphs(Menu menu, Gadget active) { - _page = page; + super(menu, active); } - - public void onClick(Player player, ClickType clickType) + + @Override + protected void leftClick(Player player) { - _page.getShop().openPageForPlayer(player, new MorphPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Morphs", player)); + getMenu().getShop().openPageForPlayer(player, new MorphPage(getMenu().getPlugin(), getMenu().getShop(), getMenu().getClientManager(), getMenu().getDonationManager(), "Morphs", player)); } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenMounts.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenMounts.java index d71c566a8..17dea9154 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenMounts.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenMounts.java @@ -2,6 +2,8 @@ package mineplex.core.cosmetic.ui.button; import mineplex.core.cosmetic.ui.page.Menu; import mineplex.core.cosmetic.ui.page.MountPage; +import mineplex.core.gadget.types.Gadget; +import mineplex.core.mount.Mount; import mineplex.core.shop.item.IButton; import org.bukkit.entity.Player; @@ -9,15 +11,28 @@ import org.bukkit.event.inventory.ClickType; public class OpenMounts implements IButton { - private Menu _page; - - public OpenMounts(Menu page) + private Menu _menu; + private Mount _active; + + public OpenMounts(Menu menu, Mount active) { - _page = page; + _menu = menu; + _active = active; } - + + @Override public void onClick(Player player, ClickType clickType) { - _page.getShop().openPageForPlayer(player, new MountPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Mounts", player)); + if (clickType.isLeftClick()) + _menu.getShop().openPageForPlayer(player, new MountPage(_menu.getPlugin(), _menu.getShop(), _menu.getClientManager(), _menu.getDonationManager(), "Mounts", player)); + else + { + if (_active != null) + { + _menu.playAcceptSound(player); + _active.Disable(player); + _menu.refresh(); + } + } } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenMusic.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenMusic.java index 72d1c2d18..b158901cc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenMusic.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenMusic.java @@ -4,22 +4,19 @@ import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import mineplex.core.cosmetic.ui.page.Menu; +import mineplex.core.gadget.types.Gadget; import mineplex.core.shop.item.IButton; -/** - * Created by shaun on 14-09-15. - */ -public class OpenMusic implements IButton +public class OpenMusic extends OpenPageButton { - private Menu _menu; - - public OpenMusic(Menu menu) + public OpenMusic(Menu menu, Gadget active) { - _menu = menu; + super(menu, active); } - public void onClick(Player player, ClickType clickType) + @Override + protected void leftClick(Player player) { - _menu.openMusic(player); + getMenu().openMusic(player); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenPageButton.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenPageButton.java new file mode 100644 index 000000000..7e0a4159a --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenPageButton.java @@ -0,0 +1,48 @@ +package mineplex.core.cosmetic.ui.button; + +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; + +import mineplex.core.cosmetic.ui.page.Menu; +import mineplex.core.gadget.types.Gadget; +import mineplex.core.shop.item.IButton; + +public abstract class OpenPageButton implements IButton +{ + private Menu _menu; + private Gadget _active; + + public OpenPageButton(Menu menu, Gadget active) + { + _active = active; + _menu = menu; + } + + @Override + public void onClick(Player player, ClickType clickType) + { + if (clickType.isLeftClick()) + leftClick(player); + else + { + if (_active != null) + { + _menu.playAcceptSound(player); + _active.Disable(player); + _menu.refresh(); + } + } + } + + protected Menu getMenu() + { + return _menu; + } + + protected Gadget getActive() + { + return _active; + } + + protected abstract void leftClick(Player player); +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenParticles.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenParticles.java index 37e9cf1e1..b464e0b22 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenParticles.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenParticles.java @@ -2,22 +2,23 @@ package mineplex.core.cosmetic.ui.button; import mineplex.core.cosmetic.ui.page.Menu; import mineplex.core.cosmetic.ui.page.ParticlePage; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.Gadget; import mineplex.core.shop.item.IButton; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; -public class OpenParticles implements IButton +public class OpenParticles extends OpenPageButton { - private Menu _page; - - public OpenParticles(Menu page) + public OpenParticles(Menu menu, Gadget active) { - _page = page; + super(menu, active); } - public void onClick(Player player, ClickType clickType) + @Override + protected void leftClick(Player player) { - _page.getShop().openPageForPlayer(player, new ParticlePage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Particles", player)); + getMenu().getShop().openPageForPlayer(player, new ParticlePage(getMenu().getPlugin(), getMenu().getShop(), getMenu().getClientManager(), getMenu().getDonationManager(), "Particles", player)); } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenPets.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenPets.java index fdaaa0e19..78c7790e0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenPets.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenPets.java @@ -1,7 +1,9 @@ package mineplex.core.cosmetic.ui.button; import mineplex.core.cosmetic.ui.page.Menu; +import mineplex.core.cosmetic.ui.page.MountPage; import mineplex.core.cosmetic.ui.page.PetPage; +import mineplex.core.pet.Pet; import mineplex.core.shop.item.IButton; import org.bukkit.entity.Player; @@ -9,16 +11,23 @@ import org.bukkit.event.inventory.ClickType; public class OpenPets implements IButton { - private Menu _page; - - public OpenPets(Menu page) + private Menu _menu; + + public OpenPets(Menu menu) { - _page = page; + _menu = menu; } @Override public void onClick(Player player, ClickType clickType) { - _page.getShop().openPageForPlayer(player, new PetPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Pets", player)); + if (clickType.isLeftClick()) + _menu.getShop().openPageForPlayer(player, new PetPage(_menu.getPlugin(), _menu.getShop(), _menu.getClientManager(), _menu.getDonationManager(), "Pets", player)); + else + { + _menu.playAcceptSound(player); + _menu.getPlugin().getPetManager().RemovePet(player, true); + _menu.refresh(); + } } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java index b191a0d93..cfbfd261b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java @@ -1,5 +1,6 @@ package mineplex.core.cosmetic.ui.page; +import java.util.ArrayList; import java.util.EnumMap; import java.util.List; @@ -41,6 +42,7 @@ import mineplex.core.shop.item.ShopItem; import mineplex.core.shop.page.ConfirmationPage; import mineplex.core.shop.page.ShopPageBase; import mineplex.core.treasure.TreasureKey; +import mineplex.core.treasure.TreasureType; public class Menu extends ShopPageBase { @@ -54,13 +56,19 @@ public class Menu extends ShopPageBase @Override protected void buildPage() { -// Donor donor = getDonationManager().Get(getPlayer()); + // Treasure Shards + int treasureShards = getDonationManager().Get(getPlayer()).getCoins(); -// addItem(2, new ShopItem(CurrencyType.Gems.GetDisplayMaterial(), donor.GetGems() + " Gems", new String[] { -// " " -// }, 1, false)); + List shardLore = new ArrayList(); + shardLore.add(" "); + shardLore.add(C.cGray + "This seems like it might come in"); + shardLore.add(C.cGray + "handy. Maybe I can collect more!"); - int[] slots = UtilUI.getIndicesFor(12, 1); + ShopItem shards = new ShopItem(Material.PRISMARINE_SHARD, C.cAqua + C.Bold + treasureShards + " Treasure Shards", shardLore.toArray(new String[0]), 0, false); + addItem(4, shards); + + // Cosmetic Items + int[] slots = UtilUI.getIndicesFor(12, 2); int particleSlot = slots[0]; int arrowSlot = slots[1]; int jumpSlot = slots[2]; @@ -99,16 +107,6 @@ public class Menu extends ShopPageBase final Gadget gadget = getPlugin().getGadgetManager().getActive(getPlayer(), type); if(gadget != null) enabled.put(type, gadget); - -// addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), C.mItem + gadget.GetName(), new String[0], 1, false, false), -// new IButton() -// { -// public void onClick(Player player, ClickType clickType) { -// playAcceptSound(player); -// gadget.Disable(player); -// refresh(); -// }; -// }); } int mountOwned = 0; @@ -139,36 +137,36 @@ public class Menu extends ShopPageBase GadgetType type = GadgetType.Particle; String[] lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); - addButton(particleSlot, new ShopItem(Material.NETHER_STAR, "Particle Effects", lore, 1, false), new OpenParticles(this)); + addButton(particleSlot, new ShopItem(Material.NETHER_STAR, "Particle Effects", lore, 1, false), new OpenParticles(this, enabled.get(type))); if (enabled.containsKey(type)) addGlow(particleSlot); type = GadgetType.ArrowTrail; lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); - addButton(arrowSlot, new ShopItem(Material.ARROW, "Arrow Trails", lore, 1, false), new OpenArrowTrails(this)); + addButton(arrowSlot, new ShopItem(Material.ARROW, "Arrow Trails", lore, 1, false), new OpenArrowTrails(this, enabled.get(type))); if (enabled.containsKey(type)) addGlow(arrowSlot); type = GadgetType.DoubleJump; lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); - addButton(jumpSlot, new ShopItem(Material.GOLD_BOOTS, "Double Jump Effects", lore, 1, false), new OpenDoubleJump(this)); + addButton(jumpSlot, new ShopItem(Material.GOLD_BOOTS, "Double Jump Effects", lore, 1, false), new OpenDoubleJump(this, enabled.get(type))); if (enabled.containsKey(type)) addGlow(jumpSlot); type = GadgetType.Death; lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); - addButton(deathSlot, new ShopItem(Material.SKULL_ITEM, "Death Animations", lore, 1, false), new OpenDeathAnimations(this)); + addButton(deathSlot, new ShopItem(Material.SKULL_ITEM, "Death Animations", lore, 1, false), new OpenDeathAnimations(this, enabled.get(type))); if (enabled.containsKey(type)) addGlow(deathSlot); type = GadgetType.Item; lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); - addButton(gadgetSlot, new ShopItem(Material.MELON_BLOCK, "Gadgets", lore, 1, false), new OpenGadgets(this)); + addButton(gadgetSlot, new ShopItem(Material.MELON_BLOCK, "Gadgets", lore, 1, false), new OpenGadgets(this, enabled.get(type))); if (enabled.containsKey(type)) addGlow(gadgetSlot); type = GadgetType.Morph; lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); - addButton(morphSlot, new ShopItem(Material.LEATHER, "Morphs", lore, 1, false), new OpenMorphs(this)); + addButton(morphSlot, new ShopItem(Material.LEATHER, "Morphs", lore, 1, false), new OpenMorphs(this, enabled.get(type))); if (enabled.containsKey(type)) addGlow(morphSlot); lore = getLore(mountOwned, mountMax, mountActive == null ? null : mountActive.GetName()); - addButton(mountSlot, new ShopItem(Material.IRON_BARDING, "Mounts", lore, 1, false), new OpenMounts(this)); + addButton(mountSlot, new ShopItem(Material.IRON_BARDING, "Mounts", lore, 1, false), new OpenMounts(this, mountActive)); if (mountActive != null) addGlow(mountSlot); lore = getLore(petOwned, petMax, petActive == null ? null : petActive.getCustomName()); @@ -177,17 +175,17 @@ public class Menu extends ShopPageBase type = GadgetType.Hat; lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); - addButton(hatSlot, new ShopItem(Material.GOLD_HELMET, "Hats", lore, 1, false), new OpenHats(this)); + addButton(hatSlot, new ShopItem(Material.GOLD_HELMET, "Hats", lore, 1, false), new OpenHats(this, enabled.get(type))); if (enabled.containsKey(type)) addGlow(hatSlot); type = GadgetType.Costume; lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); - addButton(costumeSlot, new ShopItem(Material.DIAMOND_CHESTPLATE, "Costumes", lore, 1, false), new OpenCostumes(this)); + addButton(costumeSlot, new ShopItem(Material.DIAMOND_CHESTPLATE, "Costumes", lore, 1, false), new OpenCostumes(this, enabled.get(type))); if (enabled.containsKey(type)) addGlow(costumeSlot); type = GadgetType.MusicDisc; lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); - addButton(musicSlot, new ShopItem(Material.GREEN_RECORD, "Music", lore, 1, false), new OpenMusic(this)); + addButton(musicSlot, new ShopItem(Material.GREEN_RECORD, "Music", lore, 1, false), new OpenMusic(this, enabled.get(type))); if (enabled.containsKey(type)) addGlow(musicSlot); addButton(tauntSlot, new ShopItem(Material.NAME_TAG, "Taunts", new String[]{C.Bold + "", C.cDGreen + C.Italics + "Coming soon!"}, 1, false), new IButton() @@ -198,22 +196,6 @@ public class Menu extends ShopPageBase player.sendMessage(F.main("Shop", "Coming soon!")); } }); - -// if (getPlugin().getPetManager().hasActivePet(getPlayer().getName())) -// { -// Creature activePet = getPlugin().getPetManager().getActivePet(getPlayer().getName()); -// String petName = activePet.getType() == EntityType.WITHER ? "Widder" : activePet.getCustomName(); -// addButton(25 + 9, new ShopItem(Material.MONSTER_EGG, (byte) getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType().getTypeId(), C.mItem + petName, new String[0], 1, false, false), -// new IButton() -// { -// public void onClick(Player player, ClickType clickType) -// { -// playAcceptSound(player); -// getPlugin().getPetManager().RemovePet(player, true); -// refresh(); -// } -// }); -// } } private String[] getLore(int ownedCount, int maxCount, Gadget enabled) @@ -227,21 +209,21 @@ public class Menu extends ShopPageBase { return UtilText.splitLinesToArray(new String[] { C.blankLine, - C.cWhite + "You own " + C.cYellow + ownedCount + "/" + maxCount, + C.cWhite + "You own " + ownedCount + "/" + maxCount, C.blankLine, - C.cWhite + "Active: " + C.cGreen + enabled, - C.cWhite + "Right Click to Disable", + C.cWhite + "Active: " + C.cYellow + enabled, + C.cGreen + "Right-Click to Disable", C.blankLine, - C.cWhite + "Left Click to View Category" + C.cGreen + "Left-Click to View Category" }, LineFormat.LORE); } else { return UtilText.splitLinesToArray(new String[] { C.blankLine, - C.cWhite + "You own " + C.cYellow + ownedCount + "/" + maxCount, + C.cWhite + "You own " + ownedCount + "/" + maxCount, C.blankLine, - C.cWhite + "Left Click to View Category" + C.cGreen + "Left-Click to View Category" }, LineFormat.LORE); } } @@ -255,16 +237,4 @@ public class Menu extends ShopPageBase { getShop().openPageForPlayer(player, new MusicPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "Music", player)); } - - public void attemptPurchaseKey(Player player) - { - getShop().openPageForPlayer(player, new ConfirmationPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), new Runnable() - { - public void run() - { - getPlugin().getInventoryManager().addItemToInventory(getPlayer(), "Treasure Key", 1); - refresh(); - } - }, this, new TreasureKey(), CurrencyType.Coins, getPlayer())); - } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java index 889765b9b..9da74c1e0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java @@ -47,11 +47,8 @@ public class TreasurePage extends ShopPageBase List shardLore = new ArrayList(); shardLore.add(" "); - shardLore.add(F.value("Treasure Shards", "" + treasureShards)); - shardLore.add(" "); - shardLore.add(C.cGray + "Useless by itself, Treasure Shards"); - shardLore.add(C.cGray + "can be combined to forge new"); - shardLore.add(C.cGray + "and undiscovered treasures."); + shardLore.add(C.cGray + "This seems like it might come in"); + shardLore.add(C.cGray + "handy. Maybe I can collect more!"); List basicLore = new ArrayList(); basicLore.add(" "); @@ -130,7 +127,7 @@ public class TreasurePage extends ShopPageBase christmasLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop"); } - ShopItem shards = new ShopItem(Material.PRISMARINE_SHARD, C.cAqua + C.Bold + "Treasure Shards", shardLore.toArray(new String[0]), 0, false); + ShopItem shards = new ShopItem(Material.PRISMARINE_SHARD, C.cAqua + C.Bold + treasureShards + " Treasure Shards", shardLore.toArray(new String[0]), 0, false); ShopItem basic = new ShopItem(Material.CHEST, C.cGreen + C.Bold + "Old Chest", basicLore.toArray(new String[0]), 0, false, false); ShopItem heroic = new ShopItem(Material.TRAPPED_CHEST, C.cGold + C.Bold + "Ancient Chest", heroicLore.toArray(new String[0]), 0, false, false); ShopItem legendary = new ShopItem(Material.ENDER_CHEST, C.cRed + C.Bold + "Mythical Chest", legendaryLore.toArray(new String[0]), 0, false, false);