use of com.github.stefvanschie.inventoryframework.pane.OutlinePane in project Nodewar by Rosstail.
the class EmpiresListGUI method initGUI.
public static void initGUI(Player player, fr.rosstail.nodewar.Nodewar plugin) {
FileConfiguration customConfig = new YamlConfiguration();
String path = "gui/empireListGUI.yml";
File file = new File(plugin.getDataFolder(), path);
try {
customConfig.load(file);
ChestGui gui = new ChestGui(customConfig.getInt("gui.size"), AdaptMessage.playerMessage(player, customConfig.getString("gui.display")));
OutlinePane background = new OutlinePane(0, 0, 9, gui.getRows(), Pane.Priority.LOWEST);
background.addItem(new GuiItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE)));
background.setRepeat(true);
gui.addPane(background);
StaticPane itemSlot = new StaticPane(customConfig.getInt("gui.item-slot.x"), customConfig.getInt("gui.item-slot.y"), 9, gui.getRows(), Pane.Priority.HIGHEST);
initPane(player, plugin, customConfig, itemSlot, gui);
gui.setOnGlobalClick(event -> {
event.setCancelled(true);
initPane(player, plugin, customConfig, itemSlot, gui);
gui.update();
});
gui.addPane(itemSlot);
gui.show(player);
} catch (IOException | InvalidConfigurationException e) {
AdaptMessage.print("[" + Nodewar.getDimName() + "] Error while reading " + path + " file", AdaptMessage.prints.ERROR);
}
}
use of com.github.stefvanschie.inventoryframework.pane.OutlinePane in project Nodewar by Rosstail.
the class WorldsGUIs method initGUI.
public static void initGUI(Player player, Nodewar plugin) {
int invSize = 6;
String display = "Worlds - Page 1";
ChestGui gui = new ChestGui(invSize, AdaptMessage.playerMessage(player, display));
PaginatedPane paginatedPane = new PaginatedPane(0, 0, 9, invSize);
OutlinePane background = new OutlinePane(0, 0, 9, gui.getRows(), Pane.Priority.LOWEST);
background.addItem(new GuiItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE)));
background.setRepeat(true);
gui.addPane(background);
int page = 0;
while (true) {
StaticPane staticPane = initPane(player, plugin, gui, paginatedPane, page);
paginatedPane.addPane(page, staticPane);
if (staticPane.getItems().size() < 47) {
// 9 * 5 lines + 2 buttons
break;
}
page++;
}
gui.setOnGlobalClick(event -> {
event.setCancelled(true);
});
gui.addPane(paginatedPane);
gui.show(player);
}
use of com.github.stefvanschie.inventoryframework.pane.OutlinePane in project Nodewar by Rosstail.
the class PlayerAdminGUI method initGUI.
public static void initGUI(Player player, Nodewar plugin, Player target, ChestGui previousGui) {
int invSize = 1;
ChestGui gui = new ChestGui(invSize, AdaptMessage.playerMessage(target, target.getName()));
StaticPane staticPane = initPane(player, plugin, gui, previousGui, target);
OutlinePane background = new OutlinePane(0, 0, 9, gui.getRows(), Pane.Priority.LOWEST);
background.addItem(new GuiItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE)));
background.setRepeat(true);
gui.addPane(background);
gui.setOnGlobalClick(event -> {
event.setCancelled(true);
});
gui.addPane(staticPane);
gui.show(player);
}
use of com.github.stefvanschie.inventoryframework.pane.OutlinePane in project Nodewar by Rosstail.
the class PlayerInfoGUI method initGUI.
public static void initGUI(Player player, fr.rosstail.nodewar.Nodewar plugin) {
FileConfiguration customConfig = new YamlConfiguration();
String path = "gui/playerInfoGUI.yml";
File file = new File(plugin.getDataFolder(), path);
try {
customConfig.load(file);
ChestGui gui = new ChestGui(customConfig.getInt("gui.size"), AdaptMessage.playerMessage(player, customConfig.getString("gui.display")));
OutlinePane background = new OutlinePane(0, 0, 9, gui.getRows(), Pane.Priority.LOWEST);
background.addItem(new GuiItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE)));
background.setRepeat(true);
gui.addPane(background);
StaticPane itemSlot = new StaticPane(customConfig.getInt("gui.item-slot.x"), customConfig.getInt("gui.item-slot.y"), 9, gui.getRows(), Pane.Priority.HIGHEST);
initPane(player, plugin, customConfig, itemSlot);
gui.setOnGlobalClick(event -> {
event.setCancelled(true);
initPane(player, plugin, customConfig, itemSlot);
gui.update();
});
gui.addPane(itemSlot);
gui.show(player);
} catch (IOException | InvalidConfigurationException e) {
AdaptMessage.print("[" + Nodewar.getDimName() + "] Error while reading " + path + " file", AdaptMessage.prints.ERROR);
}
}
use of com.github.stefvanschie.inventoryframework.pane.OutlinePane in project Nodewar by Rosstail.
the class WorldTerritoriesGUIs method initGUI.
public static void initGUI(Player player, Nodewar plugin, World world, ChestGui previousGui) {
int invSize = 6;
String display = world.getName() + "'s Territories - Page 1";
ChestGui gui = new ChestGui(invSize, AdaptMessage.playerMessage(player, display));
PaginatedPane paginatedPane = new PaginatedPane(0, 0, 9, invSize);
OutlinePane background = new OutlinePane(0, 0, 9, gui.getRows(), Pane.Priority.LOWEST);
background.addItem(new GuiItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE)));
background.setRepeat(true);
gui.addPane(background);
int page = 0;
while (true) {
StaticPane staticPane = initPane(player, plugin, gui, previousGui, paginatedPane, world, page);
paginatedPane.addPane(page, staticPane);
if (staticPane.getItems().size() < 47) {
// 9 * 5 lines + 2 buttons
break;
}
page++;
}
gui.setOnGlobalClick(event -> {
event.setCancelled(true);
});
gui.addPane(paginatedPane);
gui.show(player);
}
Aggregations