Add selection page for Heroes of GWEN training / normal game

This commit is contained in:
cnr 2017-07-13 22:31:22 -07:00
parent 1c75ec3f89
commit 22676ab9e3
2 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,52 @@
package mineplex.hub.server.ui;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.C;
import mineplex.core.donation.DonationManager;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.shop.page.ShopPageBase;
import mineplex.hub.server.ServerManager;
import mineplex.serverdata.data.ServerGroup;
public class MOBAServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
{
private final ServerGroup _serverGroup;
public MOBAServerTypePage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, DonationManager donationManager, Player player, ServerGroup serverGroup)
{
super(plugin, shop, clientManager, donationManager, "Super Smash Mobs ", player, 27);
_serverGroup = serverGroup;
buildPage();
}
@Override
protected void buildPage()
{
setItem(12, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 4).setTitle(C.Reset + C.cGold + "Play " + C.cYellow + "Heroes of GWEN")
.addLore(new String[]
{
C.Reset + "",
C.Reset + C.cGreen + "Click to Play",
}).build());
setItem(14, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setTitle(C.Reset + C.cYellow + "Heroes of GWEN " + C.cGold + "Training")
.addLore(new String[]
{
C.Reset + "",
C.Reset + C.cGreen + "Click to Play",
}).build());
getButtonMap().put(12, (player, __) -> getShop().openPageForPlayer(player, new ServerTypePage(getPlugin(), getShop(), getClientManager(), getDonationManager(), player, _serverGroup)));
getButtonMap().put(14, (player, __) -> getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "Heroes of GWEN Training", player, "MOBAT")));
}
public void Update()
{
getButtonMap().clear();
buildPage();
}
}

View File

@ -41,6 +41,9 @@ public class ServerNpcShop extends ShopBase<ServerManager>
case "SSM":
return new SuperSmashMobsServerTypePage(getPlugin(), this, getClientManager(), getDonationManager(), player, _serverGroup);
case "MOBA":
return new MOBAServerTypePage(getPlugin(), this, getClientManager(), getDonationManager(), player, _serverGroup);
default:
return new ServerNpcPage(getPlugin(), this, getClientManager(), getDonationManager(), _serverGroup.getServerNpcName(), player, _serverGroup.getPrefix());
}