Search in sources :

Example 21 with OutlinePane

use of com.github.stefvanschie.inventoryframework.pane.OutlinePane in project Nodewar by Rosstail.

the class TerritoryPointsGUIs method initGUI.

public static void initGUI(Player player, Nodewar plugin, Territory territory, ChestGui previousGui) {
    int invSize = 6;
    String display = territory.getDisplay() + "'s points - 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, territory, 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);
}
Also used : ChestGui(com.github.stefvanschie.inventoryframework.gui.type.ChestGui) GuiItem(com.github.stefvanschie.inventoryframework.gui.GuiItem) PaginatedPane(com.github.stefvanschie.inventoryframework.pane.PaginatedPane) OutlinePane(com.github.stefvanschie.inventoryframework.pane.OutlinePane) StaticPane(com.github.stefvanschie.inventoryframework.pane.StaticPane) ItemStack(org.bukkit.inventory.ItemStack)

Example 22 with OutlinePane

use of com.github.stefvanschie.inventoryframework.pane.OutlinePane in project Nodewar by Rosstail.

the class TerritoryEmpireGUIs method initGUI.

public static void initGUI(Player player, Nodewar plugin, ChestGui previousGui, Territory territory) {
    int invSize = 6;
    String display = territory.getDisplay() + "'s Empires - 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, territory, 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);
}
Also used : ChestGui(com.github.stefvanschie.inventoryframework.gui.type.ChestGui) GuiItem(com.github.stefvanschie.inventoryframework.gui.GuiItem) PaginatedPane(com.github.stefvanschie.inventoryframework.pane.PaginatedPane) OutlinePane(com.github.stefvanschie.inventoryframework.pane.OutlinePane) StaticPane(com.github.stefvanschie.inventoryframework.pane.StaticPane) ItemStack(org.bukkit.inventory.ItemStack)

Example 23 with OutlinePane

use of com.github.stefvanschie.inventoryframework.pane.OutlinePane in project Nodewar by Rosstail.

the class TerritoryGUIs method initGUI.

public static void initGUI(Player player, Nodewar plugin, Territory territory, ChestGui previousGui) {
    int invSize = 2;
    ChestGui gui = new ChestGui(invSize, AdaptMessage.playerMessage(player, territory.getDisplay()));
    StaticPane staticPane = initPane(player, plugin, gui, previousGui, territory);
    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);
}
Also used : ChestGui(com.github.stefvanschie.inventoryframework.gui.type.ChestGui) GuiItem(com.github.stefvanschie.inventoryframework.gui.GuiItem) OutlinePane(com.github.stefvanschie.inventoryframework.pane.OutlinePane) StaticPane(com.github.stefvanschie.inventoryframework.pane.StaticPane) ItemStack(org.bukkit.inventory.ItemStack)

Aggregations

OutlinePane (com.github.stefvanschie.inventoryframework.pane.OutlinePane)23 GuiItem (com.github.stefvanschie.inventoryframework.gui.GuiItem)17 ChestGui (com.github.stefvanschie.inventoryframework.gui.type.ChestGui)17 ItemStack (org.bukkit.inventory.ItemStack)16 PaginatedPane (com.github.stefvanschie.inventoryframework.pane.PaginatedPane)9 StaticPane (com.github.stefvanschie.inventoryframework.pane.StaticPane)9 Material (org.bukkit.Material)7 Player (org.bukkit.entity.Player)7 YamlConfiguration (org.bukkit.configuration.file.YamlConfiguration)5 HumanEntity (org.bukkit.entity.HumanEntity)5 NotNull (org.jetbrains.annotations.NotNull)5 Main (com.gmail.stefvanschiedev.buildinggame.Main)4 MessageManager (com.gmail.stefvanschiedev.buildinggame.managers.messages.MessageManager)4 ChatColor (org.bukkit.ChatColor)4 Pane (com.github.stefvanschie.inventoryframework.pane.Pane)3 Priority (com.github.stefvanschie.inventoryframework.pane.Pane.Priority)3 SettingsManager (com.gmail.stefvanschiedev.buildinggame.managers.files.SettingsManager)3 MessageService (dte.employme.messages.service.MessageService)3 IOException (java.io.IOException)3 List (java.util.List)3