use of au.com.mineauz.minigames.menu.MenuItem in project Minigames by AddstarMC.
the class Rewards method createMenu.
public Menu createMenu(String name, MinigamePlayer player, Menu parent) {
Menu rewardMenu = new Menu(5, name, player);
rewardMenu.setPreviousPage(parent);
rewardMenu.addItem(new MenuItemRewardGroupAdd("Add Group", Material.ITEM_FRAME, this), 42);
rewardMenu.addItem(new MenuItemRewardAdd("Add Item", Material.ITEM_FRAME, this), 43);
rewardMenu.addItem(new MenuItemPage("Save " + name, Material.REDSTONE_TORCH_ON, parent), 44);
List<MenuItem> mi = new ArrayList<MenuItem>();
for (RewardType item : items) {
mi.add(item.getMenuItem());
}
List<String> des = new ArrayList<String>();
des.add("Double Click to edit");
for (RewardGroup group : groups) {
MenuItemRewardGroup rwg = new MenuItemRewardGroup(group.getName() + " Group", des, Material.CHEST, group, this);
mi.add(rwg);
}
rewardMenu.addItems(mi);
return rewardMenu;
}
use of au.com.mineauz.minigames.menu.MenuItem in project Minigames by AddstarMC.
the class TreasureHuntModule method displayMechanicSettings.
@Override
public boolean displayMechanicSettings(Menu previous) {
Menu treasureHunt = new Menu(6, getMinigame().getName(false), previous.getViewer());
List<MenuItem> itemsTreasureHunt = new ArrayList<MenuItem>(5);
itemsTreasureHunt.add(location.getMenuItem("Location Name", Material.BED, MinigameUtils.stringToList("Name to appear when;treasure spawns")));
itemsTreasureHunt.add(maxRadius.getMenuItem("Max. Radius", Material.ENDER_PEARL, 10, null));
List<String> maxHeightDes = new ArrayList<String>();
maxHeightDes.add("Max. height of where a");
maxHeightDes.add("chest can generate.");
maxHeightDes.add("Can still move above to");
maxHeightDes.add("avoid terrain");
itemsTreasureHunt.add(maxHeight.getMenuItem("Max. Height", Material.BEACON, maxHeightDes, 1, 256));
List<String> minDes = new ArrayList<String>();
minDes.add("Minimum items to");
minDes.add("spawn in chest.");
itemsTreasureHunt.add(minTreasure.getMenuItem("Min. Items", Material.STEP, minDes, 0, 27));
List<String> maxDes = new ArrayList<String>();
maxDes.add("Maximum items to");
maxDes.add("spawn in chest.");
itemsTreasureHunt.add(maxTreasure.getMenuItem("Max. Items", Material.STONE, maxDes, 0, 27));
itemsTreasureHunt.add(new MenuItemTime("Restart Delay", Material.WATCH, treasureWaitTime.getCallback(), 0, null));
itemsTreasureHunt.add(new MenuItemTime("Hint Usage Delay", Material.WATCH, hintWaitTime.getCallback(), 0, null));
treasureHunt.addItems(itemsTreasureHunt);
treasureHunt.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, previous), treasureHunt.getSize() - 9);
treasureHunt.displayMenu(treasureHunt.getViewer());
return true;
}
use of au.com.mineauz.minigames.menu.MenuItem in project Minigames by AddstarMC.
the class MenuItemNode method createMenu.
public static Menu createMenu(MinigamePlayer viewer, Menu previousPage, Node node) {
Menu m = new Menu(3, "Node: " + node.getName(), viewer);
m.setPreviousPage(previousPage);
List<MenuItem> items = new ArrayList<>();
for (NodeExecutor ex : node.getExecutors()) {
items.add(new MenuItemNodeExecutor(node, ex));
}
if (previousPage != null) {
m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, previousPage), m.getSize() - 9);
}
m.addItem(new MenuItemNodeExecutorAdd("Add Executor", Material.ITEM_FRAME, node), m.getSize() - 1);
m.addItems(items);
return m;
}
use of au.com.mineauz.minigames.menu.MenuItem in project Minigames by AddstarMC.
the class MenuItemRegion method createMenu.
public static Menu createMenu(MinigamePlayer viewer, Menu previousPage, Region region) {
Menu m = new Menu(3, "Region: " + region.getName(), viewer);
m.setPreviousPage(previousPage);
List<MenuItem> items = new ArrayList<>();
for (RegionExecutor ex : region.getExecutors()) {
items.add(new MenuItemRegionExecutor(region, ex));
}
if (previousPage != null) {
m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, previousPage), m.getSize() - 9);
}
m.addItem(new MenuItemRegionExecutorAdd("Add Executor", Material.ITEM_FRAME, region), m.getSize() - 1);
m.addItems(items);
return m;
}
use of au.com.mineauz.minigames.menu.MenuItem in project Minigames by AddstarMC.
the class SetLoadoutCommand method onCommand.
@Override
public boolean onCommand(CommandSender sender, Minigame minigame, String label, String[] args) {
MinigamePlayer player = Minigames.plugin.pdata.getMinigamePlayer((Player) sender);
Menu loadouts = new Menu(6, getName(), player);
List<MenuItem> mi = new ArrayList<MenuItem>();
LoadoutModule mod = LoadoutModule.getMinigameModule(minigame);
List<String> des = new ArrayList<String>();
des.add("Shift + Right Click to Delete");
Material item = Material.THIN_GLASS;
for (String ld : mod.getLoadouts()) {
item = Material.THIN_GLASS;
if (mod.getLoadout(ld).getItems().size() != 0) {
item = mod.getLoadout(ld).getItem((Integer) mod.getLoadout(ld).getItems().toArray()[0]).getType();
}
MenuItemDisplayLoadout mil = new MenuItemDisplayLoadout(ld, des, item, mod.getLoadout(ld), minigame);
mil.setAllowDelete(mod.getLoadout(ld).isDeleteable());
mi.add(mil);
}
loadouts.addItem(new MenuItemLoadoutAdd("Add Loadout", Material.ITEM_FRAME, mod.getLoadoutMap(), minigame), 53);
loadouts.addItems(mi);
loadouts.displayMenu(player);
return true;
}
Aggregations