Added showing of only 3 full servers in server menu.
This commit is contained in:
parent
38fd85335f
commit
f15e539841
|
@ -187,9 +187,10 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
|
|||
|
||||
private void buildAvailableServerPage(List<ServerInfo> serverList, int slotsNeeded)
|
||||
{
|
||||
int serversToShow = 5;
|
||||
int serversToShow = 7;
|
||||
int greenCount = 0;
|
||||
int yellowCount = 0;
|
||||
int maxFull = 3;
|
||||
int greenStartSlot = 18 + ((9 - serversToShow) / 2);
|
||||
boolean showGreen = true;
|
||||
|
||||
|
@ -199,6 +200,8 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
|
|||
showClock(portalTime);
|
||||
showGreen = false;
|
||||
}
|
||||
|
||||
int fullCount = 0;
|
||||
|
||||
for (ServerInfo serverInfo : serverList)
|
||||
{
|
||||
|
@ -208,11 +211,19 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
|
|||
{
|
||||
if (showGreen)
|
||||
{
|
||||
boolean full = serverInfo.MaxPlayers - serverInfo.CurrentPlayers <= 0;
|
||||
|
||||
if (full && fullCount >= maxFull)
|
||||
continue;
|
||||
|
||||
ShopItem shopItem = buildShopItem(serverInfo, slotsNeeded);
|
||||
|
||||
greenCount++;
|
||||
|
||||
AddButton(slot, shopItem, new JoinServerButton(this, serverInfo));
|
||||
|
||||
if (full)
|
||||
fullCount++;
|
||||
}
|
||||
}
|
||||
else if (isInProgress(serverInfo))
|
||||
|
|
Loading…
Reference in New Issue