Search in sources :

Example 1 with MenuItemAddTeam

use of au.com.mineauz.minigames.menu.MenuItemAddTeam in project Minigames by AddstarMC.

the class TeamsModule method addEditMenuOptions.

@Override
public void addEditMenuOptions(Menu menu) {
    Menu m = new Menu(6, "Teams", menu.getViewer());
    m.setPreviousPage(menu);
    List<MenuItem> items = new ArrayList<MenuItem>();
    List<String> teams = new ArrayList<String>(this.teams.size() + 1);
    for (TeamColor t : this.teams.keySet()) {
        teams.add(MinigameUtils.capitalize(t.toString().replace("_", " ")));
    }
    teams.add("None");
    items.add(new MenuItemList("Default Winning Team", Material.PAPER, getDefaultWinnerCallback(), teams));
    items.add(new MenuItemNewLine());
    for (Team t : this.teams.values()) {
        items.add(new MenuItemTeam(t.getChatColor() + t.getDisplayName(), t));
    }
    m.addItem(new MenuItemAddTeam("Add Team", getMinigame()), m.getSize() - 1);
    m.addItems(items);
    m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, menu), m.getSize() - 9);
    MenuItemPage p = new MenuItemPage("Team Options", Material.CHEST, m);
    menu.addItem(p);
}
Also used : MenuItemTeam(au.com.mineauz.minigames.menu.MenuItemTeam) MenuItemPage(au.com.mineauz.minigames.menu.MenuItemPage) ArrayList(java.util.ArrayList) MenuItemNewLine(au.com.mineauz.minigames.menu.MenuItemNewLine) MenuItem(au.com.mineauz.minigames.menu.MenuItem) TeamColor(au.com.mineauz.minigames.minigame.TeamColor) MenuItemAddTeam(au.com.mineauz.minigames.menu.MenuItemAddTeam) MenuItemList(au.com.mineauz.minigames.menu.MenuItemList) MenuItemAddTeam(au.com.mineauz.minigames.menu.MenuItemAddTeam) MenuItemTeam(au.com.mineauz.minigames.menu.MenuItemTeam) Team(au.com.mineauz.minigames.minigame.Team) Menu(au.com.mineauz.minigames.menu.Menu)

Aggregations

Menu (au.com.mineauz.minigames.menu.Menu)1 MenuItem (au.com.mineauz.minigames.menu.MenuItem)1 MenuItemAddTeam (au.com.mineauz.minigames.menu.MenuItemAddTeam)1 MenuItemList (au.com.mineauz.minigames.menu.MenuItemList)1 MenuItemNewLine (au.com.mineauz.minigames.menu.MenuItemNewLine)1 MenuItemPage (au.com.mineauz.minigames.menu.MenuItemPage)1 MenuItemTeam (au.com.mineauz.minigames.menu.MenuItemTeam)1 Team (au.com.mineauz.minigames.minigame.Team)1 TeamColor (au.com.mineauz.minigames.minigame.TeamColor)1 ArrayList (java.util.ArrayList)1