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;
}
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;
}
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);
}
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);
}
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));
}
Aggregations