From 672ada3f31c06ef8043091de8ca2bb26f7ce64d0 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Tue, 16 May 2017 21:14:47 -0400 Subject: [PATCH] Add Castle Assault TDM to compass --- .../mineplex/hub/server/ServerManager.java | 5 ++++ .../hub/server/ui/ServerGameMenu.java | 25 +++++++++++++++---- .../server/ui/button/SelectCATDMButton.java | 23 +++++++++++++++++ 3 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectCATDMButton.java diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java index f72c95a65..cc37b55a6 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java @@ -792,6 +792,11 @@ public class ServerManager extends MiniPlugin implements BrawlShopProvider { return _serverNpcShopMap.get("Castle Assault"); } + + public ShopBase getCastleAssaultTDMShop() + { + return _serverNpcShopMap.get("Castle Assault TDM"); + } public ShopBase getCastleSiegeShop() { diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java index 00498e1d3..07e52532f 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -22,6 +22,7 @@ import mineplex.hub.server.ui.button.SelectBLDButton; import mineplex.hub.server.ui.button.SelectBRButton; import mineplex.hub.server.ui.button.SelectBawkButton; import mineplex.hub.server.ui.button.SelectCAButton; +import mineplex.hub.server.ui.button.SelectCATDMButton; import mineplex.hub.server.ui.button.SelectCLANSButton; import mineplex.hub.server.ui.button.SelectCSButton; import mineplex.hub.server.ui.button.SelectCTFButton; @@ -62,7 +63,7 @@ public class ServerGameMenu extends ShopPageBase @Override protected void buildPage() { - add(1, Material.EGG, C.cYellowB + "Bawk Bawk Battles " + C.cGray + "Challenges", new String[] + add(0, Material.EGG, C.cYellowB + "Bawk Bawk Battles " + C.cGray + "Challenges", new String[] { C.Reset + "", C.Reset + "Follow Bawk Bawk's instructions", @@ -70,16 +71,25 @@ public class ServerGameMenu extends ShopPageBase C.Reset + "If you lose, chickens will devour you!" }, "BBB", "Bawk_Bawk_Battles", new SelectBawkButton(this)); - add(3, Material.DIAMOND_CHESTPLATE, C.cYellowB + "Castle Assault " + C.cGray + "Fast Paced PvP", new String[] + add(2, Material.DIAMOND_CHESTPLATE, C.cYellowB + "Castle Assault " + C.cGray + "Fast Paced PvP", new String[] { - (_extraValue ? C.cAquaB : C.cWhiteB) + "NEW GAME", + (_extraValue ? C.cAquaB : C.cWhiteB) + "NEW UPDATES", C.Reset + "", C.Reset + "Combatants must battle to", C.Reset + "win the day for their king", C.Reset + "at all costs!", }, "CA", "Castle_Assault", new SelectCAButton(this)); + + add(4, Material.DIAMOND_CHESTPLATE, C.cYellowB + "Castle Assault TDM " + C.cGray + "Team PvP", new String[] + { + (_extraValue ? C.cAquaB : C.cWhiteB) + "NEW GAME", + C.Reset + "", + C.Reset + "Combatants must battle to", + C.Reset + "win glory for their team", + C.Reset + "by slaying the enemy!", + }, "CATDM", "Castle_Assault_TDM", new SelectCATDMButton(this)); - add(5, Material.QUARTZ_BLOCK, C.cYellowB + "Speed Builders " + C.cGray + "Competitive Building", new String[] + add(6, Material.QUARTZ_BLOCK, C.cYellowB + "Speed Builders " + C.cGray + "Competitive Building", new String[] { C.Reset + "", C.Reset + "Memorize Gwen the Guardian's builds", @@ -87,7 +97,7 @@ public class ServerGameMenu extends ShopPageBase C.Reset + "The least correct builder is eliminated.", }, "SB", "Speed_Builders", new SelectSBButton(this)); - add(7, Material.TNT, C.cYellowB + "Dragon Escape " + C.cGray + "Fast Paced Parkour", new String[] + add(8, Material.TNT, C.cYellowB + "Dragon Escape " + C.cGray + "Fast Paced Parkour", new String[] { (_extraValue ? C.cAquaB : C.cWhiteB) + "FEATURED ARCADE GAME", C.Reset + "", @@ -645,6 +655,11 @@ public class ServerGameMenu extends ShopPageBase { getPlugin().getCastleAssaultShop().attemptShopOpen(player); } + + public void openCATDM(Player player) + { + getPlugin().getCastleAssaultTDMShop().attemptShopOpen(player); + } public void openCS(Player player) { diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectCATDMButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectCATDMButton.java new file mode 100644 index 000000000..409d0c4b4 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectCATDMButton.java @@ -0,0 +1,23 @@ +package mineplex.hub.server.ui.button; + +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; + +import mineplex.core.shop.item.IButton; +import mineplex.hub.server.ui.ServerGameMenu; + +public class SelectCATDMButton implements IButton +{ + private ServerGameMenu _menu; + + public SelectCATDMButton(ServerGameMenu menu) + { + _menu = menu; + } + + @Override + public void onClick(Player player, ClickType clickType) + { + _menu.openCATDM(player); + } +}