Search in sources :

Example 1 with MenuItemRewardAdd

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

the class Rewards method createMenu.

public Menu createMenu(String name, MinigamePlayer player, Menu parent) {
    Menu rewardMenu = new Menu(5, name, player);
    rewardMenu.setPreviousPage(parent);
    rewardMenu.addItem(new MenuItemRewardGroupAdd("Add Group", Material.ITEM_FRAME, this), 42);
    rewardMenu.addItem(new MenuItemRewardAdd("Add Item", Material.ITEM_FRAME, this), 43);
    rewardMenu.addItem(new MenuItemPage("Save " + name, Material.REDSTONE_TORCH_ON, parent), 44);
    List<MenuItem> mi = new ArrayList<MenuItem>();
    for (RewardType item : items) {
        mi.add(item.getMenuItem());
    }
    List<String> des = new ArrayList<String>();
    des.add("Double Click to edit");
    for (RewardGroup group : groups) {
        MenuItemRewardGroup rwg = new MenuItemRewardGroup(group.getName() + " Group", des, Material.CHEST, group, this);
        mi.add(rwg);
    }
    rewardMenu.addItems(mi);
    return rewardMenu;
}
Also used : MenuItemRewardGroup(au.com.mineauz.minigames.menu.MenuItemRewardGroup) MenuItemRewardGroupAdd(au.com.mineauz.minigames.menu.MenuItemRewardGroupAdd) MenuItemRewardAdd(au.com.mineauz.minigames.menu.MenuItemRewardAdd) MenuItemPage(au.com.mineauz.minigames.menu.MenuItemPage) ArrayList(java.util.ArrayList) MenuItem(au.com.mineauz.minigames.menu.MenuItem) Menu(au.com.mineauz.minigames.menu.Menu) MenuItemRewardGroup(au.com.mineauz.minigames.menu.MenuItemRewardGroup)

Aggregations

Menu (au.com.mineauz.minigames.menu.Menu)1 MenuItem (au.com.mineauz.minigames.menu.MenuItem)1 MenuItemPage (au.com.mineauz.minigames.menu.MenuItemPage)1 MenuItemRewardAdd (au.com.mineauz.minigames.menu.MenuItemRewardAdd)1 MenuItemRewardGroup (au.com.mineauz.minigames.menu.MenuItemRewardGroup)1 MenuItemRewardGroupAdd (au.com.mineauz.minigames.menu.MenuItemRewardGroupAdd)1 ArrayList (java.util.ArrayList)1