Search in sources :

Example 6 with MenuItem

use of au.com.mineauz.minigames.menu.MenuItem 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)

Example 7 with MenuItem

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

the class TreasureHuntModule method displayMechanicSettings.

@Override
public boolean displayMechanicSettings(Menu previous) {
    Menu treasureHunt = new Menu(6, getMinigame().getName(false), previous.getViewer());
    List<MenuItem> itemsTreasureHunt = new ArrayList<MenuItem>(5);
    itemsTreasureHunt.add(location.getMenuItem("Location Name", Material.BED, MinigameUtils.stringToList("Name to appear when;treasure spawns")));
    itemsTreasureHunt.add(maxRadius.getMenuItem("Max. Radius", Material.ENDER_PEARL, 10, null));
    List<String> maxHeightDes = new ArrayList<String>();
    maxHeightDes.add("Max. height of where a");
    maxHeightDes.add("chest can generate.");
    maxHeightDes.add("Can still move above to");
    maxHeightDes.add("avoid terrain");
    itemsTreasureHunt.add(maxHeight.getMenuItem("Max. Height", Material.BEACON, maxHeightDes, 1, 256));
    List<String> minDes = new ArrayList<String>();
    minDes.add("Minimum items to");
    minDes.add("spawn in chest.");
    itemsTreasureHunt.add(minTreasure.getMenuItem("Min. Items", Material.STEP, minDes, 0, 27));
    List<String> maxDes = new ArrayList<String>();
    maxDes.add("Maximum items to");
    maxDes.add("spawn in chest.");
    itemsTreasureHunt.add(maxTreasure.getMenuItem("Max. Items", Material.STONE, maxDes, 0, 27));
    itemsTreasureHunt.add(new MenuItemTime("Restart Delay", Material.WATCH, treasureWaitTime.getCallback(), 0, null));
    itemsTreasureHunt.add(new MenuItemTime("Hint Usage Delay", Material.WATCH, hintWaitTime.getCallback(), 0, null));
    treasureHunt.addItems(itemsTreasureHunt);
    treasureHunt.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, previous), treasureHunt.getSize() - 9);
    treasureHunt.displayMenu(treasureHunt.getViewer());
    return true;
}
Also used : MenuItemTime(au.com.mineauz.minigames.menu.MenuItemTime) 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)

Example 8 with MenuItem

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

the class MenuItemNode method createMenu.

public static Menu createMenu(MinigamePlayer viewer, Menu previousPage, Node node) {
    Menu m = new Menu(3, "Node: " + node.getName(), viewer);
    m.setPreviousPage(previousPage);
    List<MenuItem> items = new ArrayList<>();
    for (NodeExecutor ex : node.getExecutors()) {
        items.add(new MenuItemNodeExecutor(node, ex));
    }
    if (previousPage != null) {
        m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, previousPage), m.getSize() - 9);
    }
    m.addItem(new MenuItemNodeExecutorAdd("Add Executor", Material.ITEM_FRAME, node), m.getSize() - 1);
    m.addItems(items);
    return m;
}
Also used : 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) NodeExecutor(au.com.mineauz.minigamesregions.executors.NodeExecutor)

Example 9 with MenuItem

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

the class MenuItemRegion method createMenu.

public static Menu createMenu(MinigamePlayer viewer, Menu previousPage, Region region) {
    Menu m = new Menu(3, "Region: " + region.getName(), viewer);
    m.setPreviousPage(previousPage);
    List<MenuItem> items = new ArrayList<>();
    for (RegionExecutor ex : region.getExecutors()) {
        items.add(new MenuItemRegionExecutor(region, ex));
    }
    if (previousPage != null) {
        m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, previousPage), m.getSize() - 9);
    }
    m.addItem(new MenuItemRegionExecutorAdd("Add Executor", Material.ITEM_FRAME, region), m.getSize() - 1);
    m.addItems(items);
    return m;
}
Also used : RegionExecutor(au.com.mineauz.minigamesregions.executors.RegionExecutor) 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)

Example 10 with MenuItem

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

the class SetLoadoutCommand method onCommand.

@Override
public boolean onCommand(CommandSender sender, Minigame minigame, String label, String[] args) {
    MinigamePlayer player = Minigames.plugin.pdata.getMinigamePlayer((Player) sender);
    Menu loadouts = new Menu(6, getName(), player);
    List<MenuItem> mi = new ArrayList<MenuItem>();
    LoadoutModule mod = LoadoutModule.getMinigameModule(minigame);
    List<String> des = new ArrayList<String>();
    des.add("Shift + Right Click to Delete");
    Material item = Material.THIN_GLASS;
    for (String ld : mod.getLoadouts()) {
        item = Material.THIN_GLASS;
        if (mod.getLoadout(ld).getItems().size() != 0) {
            item = mod.getLoadout(ld).getItem((Integer) mod.getLoadout(ld).getItems().toArray()[0]).getType();
        }
        MenuItemDisplayLoadout mil = new MenuItemDisplayLoadout(ld, des, item, mod.getLoadout(ld), minigame);
        mil.setAllowDelete(mod.getLoadout(ld).isDeleteable());
        mi.add(mil);
    }
    loadouts.addItem(new MenuItemLoadoutAdd("Add Loadout", Material.ITEM_FRAME, mod.getLoadoutMap(), minigame), 53);
    loadouts.addItems(mi);
    loadouts.displayMenu(player);
    return true;
}
Also used : MenuItemDisplayLoadout(au.com.mineauz.minigames.menu.MenuItemDisplayLoadout) MenuItemLoadoutAdd(au.com.mineauz.minigames.menu.MenuItemLoadoutAdd) MinigamePlayer(au.com.mineauz.minigames.MinigamePlayer) ArrayList(java.util.ArrayList) LoadoutModule(au.com.mineauz.minigames.minigame.modules.LoadoutModule) MenuItem(au.com.mineauz.minigames.menu.MenuItem) Material(org.bukkit.Material) Menu(au.com.mineauz.minigames.menu.Menu)

Aggregations

Menu (au.com.mineauz.minigames.menu.Menu)12 MenuItem (au.com.mineauz.minigames.menu.MenuItem)12 ArrayList (java.util.ArrayList)12 MenuItemPage (au.com.mineauz.minigames.menu.MenuItemPage)9 InteractionInterface (au.com.mineauz.minigames.menu.InteractionInterface)4 MenuItemCustom (au.com.mineauz.minigames.menu.MenuItemCustom)4 Callback (au.com.mineauz.minigames.menu.Callback)3 MenuItemDisplayLoadout (au.com.mineauz.minigames.menu.MenuItemDisplayLoadout)3 MenuItemLoadoutAdd (au.com.mineauz.minigames.menu.MenuItemLoadoutAdd)3 MenuItemNewLine (au.com.mineauz.minigames.menu.MenuItemNewLine)3 MenuItemString (au.com.mineauz.minigames.menu.MenuItemString)3 Material (org.bukkit.Material)3 MinigamePlayer (au.com.mineauz.minigames.MinigamePlayer)2 MenuItemList (au.com.mineauz.minigames.menu.MenuItemList)2 MenuItemRewardAdd (au.com.mineauz.minigames.menu.MenuItemRewardAdd)2 MenuItemRewardGroup (au.com.mineauz.minigames.menu.MenuItemRewardGroup)2 MenuItemRewardGroupAdd (au.com.mineauz.minigames.menu.MenuItemRewardGroupAdd)2 MenuItemTime (au.com.mineauz.minigames.menu.MenuItemTime)2 MinigameTool (au.com.mineauz.minigames.tool.MinigameTool)2 MinigameType (au.com.mineauz.minigames.gametypes.MinigameType)1