use of au.com.mineauz.minigamesregions.menuitems.MenuItemRegion in project Minigames by AddstarMC.
the class RegionModule method displayMenu.
public void displayMenu(MinigamePlayer viewer, Menu previous) {
Menu rm = new Menu(6, "Regions and Nodes", viewer);
List<MenuItem> items = new ArrayList<MenuItem>(regions.size());
for (String name : regions.keySet()) {
MenuItemRegion mir = new MenuItemRegion(name, Material.CHEST, regions.get(name), this);
items.add(mir);
}
items.add(new MenuItemNewLine());
for (String name : nodes.keySet()) {
MenuItemNode min = new MenuItemNode(name, Material.CHEST, nodes.get(name), this);
items.add(min);
}
rm.addItems(items);
if (previous != null)
rm.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, previous), rm.getSize() - 9);
rm.displayMenu(viewer);
}
use of au.com.mineauz.minigamesregions.menuitems.MenuItemRegion in project Minigames by AddstarMC.
the class RegionNodeEditToolMode method openChooseMenu.
private void openChooseMenu(MinigamePlayer player, RegionModule module, Set<Object> objects) {
Menu menu = new Menu(3, "Choose Region or Node", player);
StringBuilder options = new StringBuilder();
for (Object object : objects) {
if (options.length() != 0) {
options.append(", ");
}
if (object instanceof Region) {
options.append(((Region) object).getName());
MenuItemRegion item = new MenuItemRegion(((Region) object).getName(), Material.CHEST, (Region) object, module);
menu.addItem(item);
} else if (object instanceof Node) {
options.append(((Node) object).getName());
MenuItemNode item = new MenuItemNode(((Node) object).getName(), Material.STONE_BUTTON, (Node) object, module);
menu.addItem(item);
}
}
menu.addItem(new MenuItemSaveMinigame("Save", Material.REDSTONE_TORCH_ON, module.getMinigame()), menu.getSize() - 9);
menu.displayMenu(player);
player.sendMessage("Multiple regions/nodes selected: " + options.toString(), null);
}
Aggregations