Search in sources :

Example 26 with MenuItemPage

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

the class ExecuteCommandAction method displayMenu.

@Override
public boolean displayMenu(MinigamePlayer player, Menu previous) {
    Menu m = new Menu(3, "Execute Command", player);
    m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, previous), m.getSize() - 9);
    m.addItem(new MenuItemString("Command", MinigameUtils.stringToList("Do not include '/';If '//' command, start with './'"), Material.COMMAND, new Callback<String>() {

        @Override
        public void setValue(String value) {
            if (value.startsWith("./"))
                value = value.replaceFirst("./", "/");
            comd.setFlag(value);
        }

        @Override
        public String getValue() {
            return comd.getFlag();
        }
    }));
    m.addItem(silentExecute.getMenuItem("Is Silent", Material.NOTE_BLOCK, MinigameUtils.stringToList("When on, console output;for a command will be;silenced.;NOTE: Does not work with;minecraft commands")));
    m.displayMenu(player);
    return true;
}
Also used : 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 27 with MenuItemPage

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

the class ExplodeAction method displayMenu.

@Override
public boolean displayMenu(MinigamePlayer player, Menu previous) {
    Menu m = new Menu(3, "Explode", player);
    m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, previous), m.getSize() - 9);
    m.addItem(power.getMenuItem("Explosion Power", Material.TNT));
    m.addItem(fire.getMenuItem("Cause Fire", Material.FLINT_AND_STEEL));
    m.displayMenu(player);
    return true;
}
Also used : MenuItemPage(au.com.mineauz.minigames.menu.MenuItemPage) Menu(au.com.mineauz.minigames.menu.Menu)

Example 28 with MenuItemPage

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

the class Actions method displayMenu.

public static void displayMenu(MinigamePlayer player, BaseExecutor exec, Menu prev) {
    Menu m = new Menu(3, "Actions", player);
    m.setPreviousPage(prev);
    for (ActionInterface act : exec.getActions()) {
        m.addItem(new MenuItemAction(MinigameUtils.capitalize(act.getName()), Material.PAPER, exec, act));
    }
    m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, prev), m.getSize() - 9);
    m.addItem(new MenuItemActionAdd("Add Action", Material.ITEM_FRAME, exec), m.getSize() - 1);
    m.displayMenu(player);
}
Also used : MenuItemActionAdd(au.com.mineauz.minigamesregions.menuitems.MenuItemActionAdd) MenuItemPage(au.com.mineauz.minigames.menu.MenuItemPage) Menu(au.com.mineauz.minigames.menu.Menu) MenuItemAction(au.com.mineauz.minigamesregions.menuitems.MenuItemAction)

Example 29 with MenuItemPage

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

Example 30 with MenuItemPage

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

the class WeatherTimeModule method addEditMenuOptions.

@Override
public void addEditMenuOptions(Menu menu) {
    Menu m = new Menu(6, "Time and Weather", menu.getViewer());
    m.addItem(new MenuItemBoolean("Use Custom Time", Material.WATCH, new Callback<Boolean>() {

        @Override
        public void setValue(Boolean value) {
            useCustomTime.setFlag(value);
        }

        @Override
        public Boolean getValue() {
            return useCustomTime.getFlag();
        }
    }));
    m.addItem(new MenuItemInteger("Time of Day", Material.WATCH, new Callback<Integer>() {

        @Override
        public void setValue(Integer value) {
            time.setFlag(value.longValue());
        }

        @Override
        public Integer getValue() {
            return time.getFlag().intValue();
        }
    }, 0, 24000));
    m.addItem(new MenuItemBoolean("Use Custom Weather", Material.WATER_BUCKET, new Callback<Boolean>() {

        @Override
        public void setValue(Boolean value) {
            useCustomWeather.setFlag(value);
        }

        @Override
        public Boolean getValue() {
            return useCustomWeather.getFlag();
        }
    }));
    m.addItem(new MenuItemList("Weather Type", Material.WATER_BUCKET, new Callback<String>() {

        @Override
        public void setValue(String value) {
            weather.setFlag(WeatherType.valueOf(value.toUpperCase()));
        }

        @Override
        public String getValue() {
            return MinigameUtils.capitalize(weather.getFlag().toString());
        }
    }, MinigameUtils.stringToList("Clear;Downfall")));
    m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, menu), m.getSize() - 9);
    menu.addItem(new MenuItemPage("Time and Weather Settings", Material.CHEST, m));
}
Also used : MenuItemInteger(au.com.mineauz.minigames.menu.MenuItemInteger) Callback(au.com.mineauz.minigames.menu.Callback) MenuItemList(au.com.mineauz.minigames.menu.MenuItemList) MenuItemInteger(au.com.mineauz.minigames.menu.MenuItemInteger) MenuItemPage(au.com.mineauz.minigames.menu.MenuItemPage) MenuItemBoolean(au.com.mineauz.minigames.menu.MenuItemBoolean) Menu(au.com.mineauz.minigames.menu.Menu) MenuItemBoolean(au.com.mineauz.minigames.menu.MenuItemBoolean)

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