Search in sources :

Example 16 with TeamColor

use of au.com.mineauz.minigames.minigame.TeamColor in project Minigames by AddstarMC.

the class SetTeamScoreAction method displayMenu.

@Override
public boolean displayMenu(MinigamePlayer player, Menu previous) {
    Menu m = new Menu(3, "Set Team Score", player);
    m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, previous), m.getSize() - 9);
    m.addItem(score.getMenuItem("Set Score Amount", Material.STONE, null, null));
    List<String> teams = new ArrayList<>();
    teams.add("None");
    for (TeamColor team : TeamColor.values()) {
        teams.add(MinigameUtils.capitalize(team.toString()));
    }
    m.addItem(new MenuItemList("Specific Team", MinigameUtils.stringToList("If 'None', the players;team will be used"), Material.PAPER, new Callback<String>() {

        @Override
        public void setValue(String value) {
            team.setFlag(value.toUpperCase());
        }

        @Override
        public String getValue() {
            return MinigameUtils.capitalize(team.getFlag());
        }
    }, teams));
    m.displayMenu(player);
    return true;
}
Also used : Callback(au.com.mineauz.minigames.menu.Callback) MenuItemList(au.com.mineauz.minigames.menu.MenuItemList) MenuItemPage(au.com.mineauz.minigames.menu.MenuItemPage) ArrayList(java.util.ArrayList) TeamColor(au.com.mineauz.minigames.minigame.TeamColor) Menu(au.com.mineauz.minigames.menu.Menu)

Aggregations

TeamColor (au.com.mineauz.minigames.minigame.TeamColor)16 ArrayList (java.util.ArrayList)13 Menu (au.com.mineauz.minigames.menu.Menu)6 Team (au.com.mineauz.minigames.minigame.Team)6 MinigamePlayer (au.com.mineauz.minigames.MinigamePlayer)5 Callback (au.com.mineauz.minigames.menu.Callback)5 MenuItemList (au.com.mineauz.minigames.menu.MenuItemList)5 MenuItemPage (au.com.mineauz.minigames.menu.MenuItemPage)5 Minigame (au.com.mineauz.minigames.minigame.Minigame)3 List (java.util.List)3 TeamsModule (au.com.mineauz.minigames.minigame.modules.TeamsModule)2 Player (org.bukkit.entity.Player)2 InteractionInterface (au.com.mineauz.minigames.menu.InteractionInterface)1 MenuItem (au.com.mineauz.minigames.menu.MenuItem)1 MenuItemAddTeam (au.com.mineauz.minigames.menu.MenuItemAddTeam)1 MenuItemCustom (au.com.mineauz.minigames.menu.MenuItemCustom)1 MenuItemInteger (au.com.mineauz.minigames.menu.MenuItemInteger)1 MenuItemNewLine (au.com.mineauz.minigames.menu.MenuItemNewLine)1 MenuItemTeam (au.com.mineauz.minigames.menu.MenuItemTeam)1 MenuItemToolMode (au.com.mineauz.minigames.menu.MenuItemToolMode)1