Search in sources :

Example 31 with MenuItemPage

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

the class GameOverModule method addEditMenuOptions.

@Override
public void addEditMenuOptions(Menu menu) {
    Menu m = new Menu(6, "Game Over Settings", menu.getViewer());
    m.addItem(timer.getMenuItem("Time Length", Material.WATCH, 0, null));
    m.addItem(invincible.getMenuItem("Invincibility", Material.ENDER_PEARL));
    m.addItem(humiliation.getMenuItem("Humiliation Mode", Material.DIAMOND_SWORD, MinigameUtils.stringToList("Losers are stripped;of weapons and can't kill")));
    m.addItem(interact.getMenuItem("Allow Interact", Material.STONE_PLATE));
    m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, menu), m.getSize() - 9);
    menu.addItem(new MenuItemPage("Game Over Settings", Material.WOOD_DOOR, m));
}
Also used : MenuItemPage(au.com.mineauz.minigames.menu.MenuItemPage) Menu(au.com.mineauz.minigames.menu.Menu)

Example 32 with MenuItemPage

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

the class InfectionModule method displayMechanicSettings.

@Override
public boolean displayMechanicSettings(Menu previous) {
    Menu m = new Menu(6, "Infection Settings", previous.getViewer());
    m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, previous), m.getSize() - 9);
    m.addItem(infectedPercent.getMenuItem("Infected Percent", Material.SKULL_ITEM, MinigameUtils.stringToList("The percentage of players;chosen to start as;infected"), 1, 99));
    m.displayMenu(previous.getViewer());
    return true;
}
Also used : MenuItemPage(au.com.mineauz.minigames.menu.MenuItemPage) Menu(au.com.mineauz.minigames.menu.Menu)

Example 33 with MenuItemPage

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

the class PlayerFoodRangeCondition method displayMenu.

@Override
public boolean displayMenu(MinigamePlayer player, Menu prev) {
    Menu m = new Menu(3, "XP Range", player);
    m.addItem(min.getMenuItem("Min Food", Material.STEP, 0, 20));
    m.addItem(max.getMenuItem("Max Food", Material.STONE, 0, 20));
    m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, prev), m.getSize() - 9);
    addInvertMenuItem(m);
    m.displayMenu(player);
    return true;
}
Also used : MenuItemPage(au.com.mineauz.minigames.menu.MenuItemPage) Menu(au.com.mineauz.minigames.menu.Menu)

Example 34 with MenuItemPage

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

the class PlayerHasItemCondition method displayMenu.

@Override
public boolean displayMenu(MinigamePlayer player, Menu prev) {
    Menu m = new Menu(3, "Player Has Item", player);
    m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, prev), m.getSize() - 9);
    final MinigamePlayer fply = player;
    m.addItem(new MenuItemString("Item", Material.STONE, new Callback<String>() {

        @Override
        public void setValue(String value) {
            if (Material.getMaterial(value.toUpperCase()) != null)
                type.setFlag(value.toUpperCase());
            else
                fply.sendMessage("Invalid Item!", "error");
        }

        @Override
        public String getValue() {
            return type.getFlag();
        }
    }));
    m.addItem(useData.getMenuItem("Match Item Data", Material.ENDER_PEARL));
    m.addItem(data.getMenuItem("Data Value", Material.EYE_OF_ENDER, 0, null));
    m.addItem(new MenuItemList("Search Where", Material.COMPASS, new Callback<String>() {

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

        @Override
        public String getValue() {
            return WordUtils.capitalizeFully(where.getFlag());
        }
    }, Arrays.asList("Anywhere", "Hotbar", "Main", "Armor", "Slot")));
    m.addItem(slot.getMenuItem("Slot", Material.DIAMOND, 0, 35));
    m.addItem(new MenuItemNewLine());
    m.addItem(matchName.getMenuItem("Match Display Name", Material.NAME_TAG));
    MenuItemString menuItem = (MenuItemString) name.getMenuItem("Display Name", Material.NAME_TAG, MinigameUtils.stringToList("The name to match.;Use % to do a wildcard match"));
    menuItem.setAllowNull(true);
    m.addItem(menuItem);
    m.addItem(matchLore.getMenuItem("Match Lore", Material.BOOK));
    menuItem = (MenuItemString) lore.getMenuItem("Lore", Material.BOOK, MinigameUtils.stringToList("The lore to match. Separate;with semi-colons;for new lines.;Use % to do a wildcard match"));
    menuItem.setAllowNull(true);
    m.addItem(menuItem);
    addInvertMenuItem(m);
    m.displayMenu(player);
    return true;
}
Also used : MinigamePlayer(au.com.mineauz.minigames.MinigamePlayer) Callback(au.com.mineauz.minigames.menu.Callback) MenuItemList(au.com.mineauz.minigames.menu.MenuItemList) MenuItemPage(au.com.mineauz.minigames.menu.MenuItemPage) MenuItemNewLine(au.com.mineauz.minigames.menu.MenuItemNewLine) Menu(au.com.mineauz.minigames.menu.Menu) MenuItemString(au.com.mineauz.minigames.menu.MenuItemString) MenuItemString(au.com.mineauz.minigames.menu.MenuItemString)

Example 35 with MenuItemPage

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

the class MatchBlockCondition method displayMenu.

@Override
public boolean displayMenu(MinigamePlayer player, Menu prev) {
    Menu m = new Menu(3, "Match Block", player);
    m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, prev), m.getSize() - 9);
    final MenuItemCustom c = new MenuItemCustom("Auto Set Block", MinigameUtils.stringToList("Click here with a;block you wish to;match to."), Material.ITEM_FRAME);
    m.addItem(c, m.getSize() - 1);
    final MinigamePlayer ply = m.getViewer();
    final MenuItemString btype = new MenuItemString("Block Type", Material.STONE, new Callback<String>() {

        @Override
        public void setValue(String value) {
            if (Material.matchMaterial(value.toUpperCase()) != null)
                type.setFlag(value.toUpperCase());
            else
                ply.sendMessage("No block found by that name!", "error");
        }

        @Override
        public String getValue() {
            return type.getFlag();
        }
    });
    m.addItem(btype);
    final MenuItemBoolean busedur = (MenuItemBoolean) useDur.getMenuItem("Use Data Values", Material.ENDER_PEARL);
    m.addItem(busedur);
    final MenuItemInteger bdur = (MenuItemInteger) dur.getMenuItem("Data Value", Material.PAPER, 0, 16);
    m.addItem(bdur);
    c.setClickItem(new InteractionInterface() {

        @Override
        public Object interact(Object object) {
            ItemStack i = (ItemStack) object;
            type.setFlag(i.getType().toString());
            useDur.setFlag(true);
            dur.setFlag(((Short) i.getDurability()).intValue());
            bdur.updateDescription();
            busedur.updateDescription();
            btype.updateDescription();
            return c.getItem();
        }
    });
    addInvertMenuItem(m);
    m.displayMenu(player);
    return true;
}
Also used : MinigamePlayer(au.com.mineauz.minigames.MinigamePlayer) MenuItemInteger(au.com.mineauz.minigames.menu.MenuItemInteger) MenuItemPage(au.com.mineauz.minigames.menu.MenuItemPage) MenuItemString(au.com.mineauz.minigames.menu.MenuItemString) MenuItemCustom(au.com.mineauz.minigames.menu.MenuItemCustom) MenuItemString(au.com.mineauz.minigames.menu.MenuItemString) InteractionInterface(au.com.mineauz.minigames.menu.InteractionInterface) MenuItemBoolean(au.com.mineauz.minigames.menu.MenuItemBoolean) Menu(au.com.mineauz.minigames.menu.Menu) ItemStack(org.bukkit.inventory.ItemStack)

Aggregations

Menu (au.com.mineauz.minigames.menu.Menu)55 MenuItemPage (au.com.mineauz.minigames.menu.MenuItemPage)55 ArrayList (java.util.ArrayList)18 Callback (au.com.mineauz.minigames.menu.Callback)17 MenuItemList (au.com.mineauz.minigames.menu.MenuItemList)11 MenuItemString (au.com.mineauz.minigames.menu.MenuItemString)11 InteractionInterface (au.com.mineauz.minigames.menu.InteractionInterface)9 MenuItem (au.com.mineauz.minigames.menu.MenuItem)9 MenuItemCustom (au.com.mineauz.minigames.menu.MenuItemCustom)9 MenuItemNewLine (au.com.mineauz.minigames.menu.MenuItemNewLine)9 MenuItemInteger (au.com.mineauz.minigames.menu.MenuItemInteger)8 MinigamePlayer (au.com.mineauz.minigames.MinigamePlayer)7 MenuItemBoolean (au.com.mineauz.minigames.menu.MenuItemBoolean)5 TeamColor (au.com.mineauz.minigames.minigame.TeamColor)5 MenuItemTime (au.com.mineauz.minigames.menu.MenuItemTime)4 MenuItemDecimal (au.com.mineauz.minigames.menu.MenuItemDecimal)2 MinigameTool (au.com.mineauz.minigames.tool.MinigameTool)2 MenuItemCondition (au.com.mineauz.minigamesregions.menuitems.MenuItemCondition)2 MenuItemConditionAdd (au.com.mineauz.minigamesregions.menuitems.MenuItemConditionAdd)2 HashMap (java.util.HashMap)2