Reverting old Server Menus with Team sub-menu dor SSM, Skywars and SG.

This commit is contained in:
Sarah 2015-08-03 14:36:51 +02:00
parent eb16cd755a
commit fc412b0782
5 changed files with 32 additions and 10 deletions

View File

@ -772,6 +772,18 @@ public class ServerManager extends MiniPlugin
{
return _serverNpcShopMap.get("Mixed Arcade");
}
public ServerNpcShop getServerNPCShopByName(String name)
{
for(String shop : _serverNpcShopMap.keySet())
{
if(shop.equalsIgnoreCase(name))
{
return _serverNpcShopMap.get(shop);
}
}
return null;
}
public ServerNpcShop getSuperSmashMobsShop()
{

View File

@ -71,7 +71,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
ChatColor.RESET + "fight others to be the last man standing. ",
ChatColor.RESET + "Stay away from the borders!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("HG") + ChatColor.RESET + " other players!",
ChatColor.RESET + "Join " + ChatColor.GREEN + (getPlugin().getGroupTagPlayerCount("HG") + getPlugin().getGroupTagPlayerCount("SG2")) + ChatColor.RESET + " other players!",
}));
setItem(4, ItemStackFactory.Instance.CreateStack(Material.FEATHER.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Skywars " + C.cGray + "Solo/Team Survival", new String[]
@ -83,7 +83,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
ChatColor.RESET + "Way up there, death ever looming if you fall..",
ChatColor.RESET + "Can you fight? Can you live? Can you win Skywars?",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("SKY") + ChatColor.RESET + " other players!",
ChatColor.RESET + "Join " + ChatColor.GREEN + (getPlugin().getGroupTagPlayerCount("SKY") + getPlugin().getGroupTagPlayerCount("SKY2")) + ChatColor.RESET + " other players!",
}));
setItem(6, ItemStackFactory.Instance.CreateStack(Material.GOLDEN_APPLE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "UHC " + C.cGray + "Ultra Hardcore Mode", new String[]
@ -453,7 +453,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
ChatColor.RESET + "then battle other players to the ",
ChatColor.RESET + "death with your monsters skills!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("SSM") + ChatColor.RESET + " other players!",
ChatColor.RESET + "Join " + ChatColor.GREEN + (getPlugin().getGroupTagPlayerCount("SSM") + getPlugin().getGroupTagPlayerCount("SSM2")) + ChatColor.RESET + " other players!",
};
_superSmashCycle.add(ItemStackFactory.Instance.CreateStack(397, (byte)4, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch", desc));

View File

@ -55,6 +55,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
List<ServerInfo> serverList = new ArrayList<ServerInfo>(getPlugin().GetServerList(_serverNpcKey));
int slotsNeeded = 1;
if (serverList.size() > 0)
{
@ -73,6 +74,13 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
if (_onMainPage)
{
addButton(4, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BLOCK, (byte) 0, 1, C.cGreen + "Click to Join instantly!"), new IButton() {
@Override
public void onClick(Player player, ClickType clickType) {
getPlugin().selectServer(player, _serverNpcKey);
}
});
buildAvailableServerPage(serverList, slotsNeeded);
}
else

View File

@ -27,13 +27,13 @@ public class ServerNpcShop extends ShopBase<ServerManager>
@Override
protected ShopPageBase<ServerManager, ? extends ShopBase<ServerManager>> buildPagesFor(Player player)
{
if (_serverGroup.getPrefix().equalsIgnoreCase("MPS") || _serverGroup.getPrefix().equalsIgnoreCase("EVENT"))
if (_serverGroup.getPrefix().equalsIgnoreCase("SSM") || _serverGroup.getPrefix().equalsIgnoreCase("SKY") || _serverGroup.getPrefix().equalsIgnoreCase("HG"))
{
return new ServerNpcPage(getPlugin(), this, getClientManager(), getDonationManager(), _serverGroup.getServerNpcName(), player, _serverGroup.getPrefix());
return new ServerTypePage(getPlugin(), this, getClientManager(), getDonationManager(), player, _serverGroup);
}
else
{
return new ServerTypePage(getPlugin(), this, getClientManager(), getDonationManager(), player, _serverGroup);
return new ServerNpcPage(getPlugin(), this, getClientManager(), getDonationManager(), _serverGroup.getServerNpcName(), player, _serverGroup.getPrefix());
}
}
@ -79,7 +79,7 @@ public class ServerNpcShop extends ShopBase<ServerManager>
getPlugin().getHubManager().GetVisibility().removeHiddenPlayer(player);
}
@Override
/*@Override
public boolean attemptShopOpen(Player player)
{
if (_serverGroup.getTeamServerKey().isEmpty() && !_serverGroup.getPrefix().equalsIgnoreCase("EVENT") && !_serverGroup.getPrefix().equalsIgnoreCase("MPS")) // Has no team server key, so auto-join
@ -89,5 +89,5 @@ public class ServerNpcShop extends ShopBase<ServerManager>
}
return super.attemptShopOpen(player);
}
}*/
}

View File

@ -80,11 +80,13 @@ public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
{
if (team)
{
getPlugin().selectServer(player, _serverGroup.getTeamServerKey()); // TODO: Grab the team-key instead of regular game key
//getPlugin().selectServer(player, _serverGroup.getTeamServerKey()); // TODO: Grab the team-key instead of regular game key
getPlugin().getServerNPCShopByName(_serverGroup.getServerNpcName() + " 2").attemptShopOpen(player);
}
else
{
getPlugin().selectServer(player, _serverGroup.getPrefix());
//getPlugin().selectServer(player, _serverGroup.getPrefix());
getPlugin().getServerNPCShopByName(_serverGroup.getServerNpcName()).attemptShopOpen(player);
}
}
}