UI improvements - icon changes, whitelist toggle, notify messages
This commit is contained in:
parent
2677d2e557
commit
604243dfa3
@ -48,10 +48,20 @@ public class EditRotationPage extends BasePage
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(Player player, ClickType clickType)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
|
String announceString = C.Bold + type.GetLobbyName();
|
||||||
|
|
||||||
if (Plugin.GetServerConfig().GameList.contains(type))
|
if (Plugin.GetServerConfig().GameList.contains(type))
|
||||||
|
{
|
||||||
Plugin.GetServerConfig().GameList.remove(type);
|
Plugin.GetServerConfig().GameList.remove(type);
|
||||||
|
announceString = C.cRed + announceString + " removed from rotation.";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
Plugin.GetServerConfig().GameList.add(type);
|
Plugin.GetServerConfig().GameList.add(type);
|
||||||
|
announceString = C.cGreen + announceString + " added to rotation.";
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugin.GetGame().Announce(announceString);
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
}, itemCount);
|
}, itemCount);
|
||||||
|
@ -36,16 +36,16 @@ public class MenuPage extends BasePage
|
|||||||
AddButton(1 + 18, new ShopItem(Material.BOOK, "Edit Game Rotation", new String[]{}, 1, false), editRotationButton);
|
AddButton(1 + 18, new ShopItem(Material.BOOK, "Edit Game Rotation", new String[]{}, 1, false), editRotationButton);
|
||||||
|
|
||||||
GiveAdminButton giveAdminButton = new GiveAdminButton(Plugin, Shop);
|
GiveAdminButton giveAdminButton = new GiveAdminButton(Plugin, Shop);
|
||||||
AddButton(3 + 9, new ShopItem(Material.ENDER_CHEST, "Give Admin", new String[] {}, 1, false), giveAdminButton);
|
AddButton(3 + 9, new ShopItem(Material.DIAMOND_SWORD, "Give Admin", new String[] {}, 1, false), giveAdminButton);
|
||||||
|
|
||||||
OptionsButton optionsButton = new OptionsButton(Plugin, Shop);
|
OptionsButton optionsButton = new OptionsButton(Plugin, Shop);
|
||||||
AddButton(5 + 9, new ShopItem(Material.LEVER, "Toggle Game Settings", new String[] {}, 1, false), optionsButton);
|
AddButton(5 + 9, new ShopItem(Material.REDSTONE_COMPARATOR, "Game Options", new String[] {}, 1, false), optionsButton);
|
||||||
|
|
||||||
BanButton banButton = new BanButton(Plugin, Shop);
|
BanButton banButton = new BanButton(Plugin, Shop);
|
||||||
AddButton(7 + 9, new ShopItem(Material.MONSTER_EGG, "Ban Player", new String[] {}, 1, false), banButton);
|
AddButton(7 + 9, new ShopItem(Material.LAVA_BUCKET, "Ban Player", new String[] {}, 1, false), banButton);
|
||||||
|
|
||||||
UnbanButton unbanButton = new UnbanButton(Plugin, Shop);
|
UnbanButton unbanButton = new UnbanButton(Plugin, Shop);
|
||||||
AddButton(7 + 18, new ShopItem(Material.PAPER, "Unban Player", new String[] {}, 1, false), unbanButton);
|
AddButton(7 + 18, new ShopItem(Material.WATER_BUCKET, "Unban Player", new String[] {}, 1, false), unbanButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ItemStack getOwnerHead()
|
private ItemStack getOwnerHead()
|
||||||
|
@ -34,7 +34,16 @@ public class OptionsPage extends BasePage
|
|||||||
//GameTimeout
|
//GameTimeout
|
||||||
//PlayerKickIdle
|
//PlayerKickIdle
|
||||||
|
|
||||||
buildPreference(10, Material.BONE, "Force Team Balancing", _config.TeamForceBalance, new IButton()
|
buildPreference(18, Material.LEVER, "Enforce Whitelist", true/* TODO */, new IButton()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
toggleWhitelist();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
buildPreference(20, Material.BONE, "Force Team Balancing", _config.TeamForceBalance, new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(Player player, ClickType clickType)
|
public void onClick(Player player, ClickType clickType)
|
||||||
@ -43,7 +52,7 @@ public class OptionsPage extends BasePage
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
buildPreference(12, Material.REDSTONE_TORCH_ON, "Game Auto Start", _config.GameAutoStart, new IButton()
|
buildPreference(22, Material.REDSTONE_TORCH_ON, "Game Auto Start", _config.GameAutoStart, new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(Player player, ClickType clickType)
|
public void onClick(Player player, ClickType clickType)
|
||||||
@ -52,7 +61,7 @@ public class OptionsPage extends BasePage
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
buildPreference(14, Material.COMPASS, "Game Timeout", _config.GameTimeout, new IButton()
|
buildPreference(24, Material.COMPASS, "Game Timeout", _config.GameTimeout, new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(Player player, ClickType clickType)
|
public void onClick(Player player, ClickType clickType)
|
||||||
@ -61,7 +70,7 @@ public class OptionsPage extends BasePage
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
buildPreference(16, Material.WATCH, "Kick Idle Players", _config.PlayerKickIdle, new IButton()
|
buildPreference(26, Material.WATCH, "Kick Idle Players", _config.PlayerKickIdle, new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(Player player, ClickType clickType)
|
public void onClick(Player player, ClickType clickType)
|
||||||
@ -96,6 +105,12 @@ public class OptionsPage extends BasePage
|
|||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void toggleWhitelist()
|
||||||
|
{
|
||||||
|
// TODO CHISSPIE
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
private void buildPreference(int index, Material material, String name, boolean preference, IButton button)
|
private void buildPreference(int index, Material material, String name, boolean preference, IButton button)
|
||||||
{
|
{
|
||||||
buildPreference(index, material, (byte) 0, name, preference, button);
|
buildPreference(index, material, (byte) 0, name, preference, button);
|
||||||
|
Loading…
Reference in New Issue
Block a user