Search in sources :

Example 16 with MenuItemPage

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

the class PlaySoundAction method displayMenu.

@Override
public boolean displayMenu(MinigamePlayer player, Menu previous) {
    Menu m = new Menu(3, "Play Sound", player);
    m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, previous), m.getSize() - 9);
    List<String> sounds = new ArrayList<>();
    for (Sound s : Sound.values()) sounds.add(MinigameUtils.capitalize(s.toString().replace("_", " ")));
    m.addItem(new MenuItemList("Sound", Material.NOTE_BLOCK, new Callback<String>() {

        @Override
        public void setValue(String value) {
            sound.setFlag(value.toUpperCase().replace(" ", "_"));
        }

        @Override
        public String getValue() {
            return MinigameUtils.capitalize(sound.getFlag().replace("_", " "));
        }
    }, sounds));
    m.addItem(priv.getMenuItem("Private Playback", Material.ENDER_PEARL));
    m.addItem(new MenuItemDecimal("Volume", Material.JUKEBOX, new Callback<Double>() {

        @Override
        public void setValue(Double value) {
            vol.setFlag(value.floatValue());
        }

        @Override
        public Double getValue() {
            return vol.getFlag().doubleValue();
        }
    }, 0.1, 1d, 0.5, null));
    m.addItem(new MenuItemDecimal("Pitch", Material.EYE_OF_ENDER, new Callback<Double>() {

        @Override
        public void setValue(Double value) {
            pit.setFlag(value.floatValue());
        }

        @Override
        public Double getValue() {
            return pit.getFlag().doubleValue();
        }
    }, 0.05, 0.1, 0d, 2d));
    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) Sound(org.bukkit.Sound) Menu(au.com.mineauz.minigames.menu.Menu) MenuItemDecimal(au.com.mineauz.minigames.menu.MenuItemDecimal)

Example 17 with MenuItemPage

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

the class PulseRedstoneAction method displayMenu.

@Override
public boolean displayMenu(MinigamePlayer player, Menu previous) {
    Menu m = new Menu(3, "Redstone Pulse", player);
    m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, previous), m.getSize() - 9);
    m.addItem(time.getMenuItem("Pulse Time", Material.WATCH));
    m.addItem(torch.getMenuItem("Use Redstone Torch", Material.REDSTONE_BLOCK));
    m.displayMenu(player);
    return true;
}
Also used : MenuItemPage(au.com.mineauz.minigames.menu.MenuItemPage) Menu(au.com.mineauz.minigames.menu.Menu)

Example 18 with MenuItemPage

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

the class SetBlockAction method displayMenu.

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

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

        @Override
        public String getValue() {
            return type.getFlag();
        }
    }));
    m.addItem(usedur.getMenuItem("Use Durability Value", Material.ENDER_PEARL));
    m.addItem(dur.getMenuItem("Durability Value", Material.STONE, 0, 15));
    m.displayMenu(player);
    return true;
}
Also used : MinigamePlayer(au.com.mineauz.minigames.MinigamePlayer) Callback(au.com.mineauz.minigames.menu.Callback) MenuItemPage(au.com.mineauz.minigames.menu.MenuItemPage) Menu(au.com.mineauz.minigames.menu.Menu) MenuItemString(au.com.mineauz.minigames.menu.MenuItemString) MenuItemString(au.com.mineauz.minigames.menu.MenuItemString)

Example 19 with MenuItemPage

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

the class SetScoreAction method displayMenu.

@Override
public boolean displayMenu(MinigamePlayer player, Menu previous) {
    Menu m = new Menu(3, "Set Score", player);
    m.addItem(amount.getMenuItem("Set Score Amount", Material.ENDER_PEARL, null, null));
    m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, previous), m.getSize() - 9);
    m.displayMenu(player);
    return true;
}
Also used : MenuItemPage(au.com.mineauz.minigames.menu.MenuItemPage) Menu(au.com.mineauz.minigames.menu.Menu)

Example 20 with MenuItemPage

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

the class ContainsEntireTeamCondition method displayMenu.

@Override
public boolean displayMenu(MinigamePlayer player, Menu prev) {
    Menu menu = new Menu(3, "Contains Entire Team", player);
    menu.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, prev), menu.getSize() - 9);
    addInvertMenuItem(menu);
    menu.displayMenu(player);
    return true;
}
Also used : MenuItemPage(au.com.mineauz.minigames.menu.MenuItemPage) Menu(au.com.mineauz.minigames.menu.Menu)

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