use of au.com.mineauz.minigames.menu.MenuItemPage in project Minigames by AddstarMC.
the class MatchTeamCondition method displayMenu.
@Override
public boolean displayMenu(MinigamePlayer player, Menu prev) {
Menu m = new Menu(3, "Match Team", player);
m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, prev), m.getSize() - 9);
List<String> teams = new ArrayList<String>();
for (TeamColor t : TeamColor.values()) teams.add(MinigameUtils.capitalize(t.toString().replace("_", " ")));
m.addItem(new MenuItemList("Team Color", Material.WOOL, new Callback<String>() {
@Override
public void setValue(String value) {
team.setFlag(value.toUpperCase().replace(" ", "_"));
}
@Override
public String getValue() {
return MinigameUtils.capitalize(team.getFlag().replace("_", " "));
}
}, teams));
addInvertMenuItem(m);
m.displayMenu(player);
return true;
}
use of au.com.mineauz.minigames.menu.MenuItemPage in project Minigames by AddstarMC.
the class MinigameTimerCondition method displayMenu.
@Override
public boolean displayMenu(MinigamePlayer player, Menu prev) {
Menu m = new Menu(3, "Minigame Timer", player);
m.addItem(new MenuItemTime("Min Time", Material.WATCH, minTime.getCallback(), 0, null));
m.addItem(new MenuItemTime("Max Time", Material.WATCH, maxTime.getCallback(), 0, null));
m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, prev), m.getSize() - 9);
addInvertMenuItem(m);
m.displayMenu(player);
return true;
}
use of au.com.mineauz.minigames.menu.MenuItemPage in project Minigames by AddstarMC.
the class PlayerCountCondition method displayMenu.
@Override
public boolean displayMenu(MinigamePlayer player, Menu prev) {
Menu m = new Menu(3, "Player Count", player);
m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, prev), m.getSize() - 9);
m.addItem(min.getMenuItem("Min Player Count", Material.STEP, 1, null));
m.addItem(max.getMenuItem("Max Player Count", Material.STONE, 1, null));
addInvertMenuItem(m);
m.displayMenu(player);
return true;
}
use of au.com.mineauz.minigames.menu.MenuItemPage in project Minigames by AddstarMC.
the class MenuItemConditionAdd method onClick.
@Override
public ItemStack onClick() {
Menu m = new Menu(6, "Conditions", getContainer().getViewer());
m.setPreviousPage(getContainer());
Map<String, Menu> cats = new HashMap<String, Menu>();
List<String> cons = new ArrayList<String>(Conditions.getAllConditionNames());
Collections.sort(cons);
for (String con : cons) {
if ((Conditions.getConditionByName(con).useInNodes() && nexec != null) || (Conditions.getConditionByName(con).useInRegions() && rexec != null)) {
String catname = Conditions.getConditionByName(con).getCategory();
if (catname == null)
catname = "misc conditions";
catname.toLowerCase();
Menu cat = null;
if (!cats.containsKey(catname)) {
cat = new Menu(6, MinigameUtils.capitalize(catname), getContainer().getViewer());
cats.put(catname, cat);
m.addItem(new MenuItemPage(MinigameUtils.capitalize(catname), Material.CHEST, cat));
cat.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, m), cat.getSize() - 9);
} else
cat = cats.get(catname);
MenuItemCustom c = new MenuItemCustom(MinigameUtils.capitalize(con), Material.PAPER);
final String fcon = con;
c.setClick(new InteractionInterface() {
@Override
public Object interact(Object object) {
ConditionInterface condition = Conditions.getConditionByName(fcon);
if (rexec != null) {
rexec.addCondition(condition);
getContainer().addItem(new MenuItemCondition(MinigameUtils.capitalize(fcon), Material.PAPER, rexec, condition));
} else {
nexec.addCondition(condition);
getContainer().addItem(new MenuItemCondition(MinigameUtils.capitalize(fcon), Material.PAPER, nexec, condition));
}
getContainer().displayMenu(getContainer().getViewer());
return null;
}
});
cat.addItem(c);
}
}
m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, getContainer()), m.getSize() - 9);
m.displayMenu(getContainer().getViewer());
return null;
}
use of au.com.mineauz.minigames.menu.MenuItemPage in project Minigames by AddstarMC.
the class MenuItemNodeExecutor method onClick.
@Override
public ItemStack onClick() {
final MinigamePlayer fviewer = getContainer().getViewer();
Menu m = new Menu(3, "Executor", fviewer);
final Menu ffm = m;
MenuItemCustom ca = new MenuItemCustom("Actions", Material.CHEST);
ca.setClick(new InteractionInterface() {
@Override
public Object interact(Object object) {
Actions.displayMenu(fviewer, ex, ffm);
return null;
}
});
m.addItem(ca);
MenuItemCustom c2 = new MenuItemCustom("Conditions", Material.CHEST);
c2.setClick(new InteractionInterface() {
@Override
public Object interact(Object object) {
Conditions.displayMenu(fviewer, ex, ffm);
return null;
}
});
m.addItem(c2);
m.addItem(new MenuItemNewLine());
m.addItem(new MenuItemInteger("Trigger Count", MinigameUtils.stringToList("Number of times this;node can be;triggered"), Material.STONE, ex.getTriggerCountCallback(), 0, null));
m.addItem(new MenuItemBoolean("Trigger Per Player", MinigameUtils.stringToList("Whether this node;is triggered per player;or just on count"), Material.ENDER_PEARL, ex.getIsTriggerPerPlayerCallback()));
m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, getContainer()), m.getSize() - 9);
m.displayMenu(fviewer);
return null;
}
Aggregations