Search in sources :

Example 1 with HORIZONTAL

use of com.github.stefvanschie.inventoryframework.pane.Orientable.Orientation.HORIZONTAL in project EmployMe by DavidTheExplorer.

the class ItemPaletteGUI method createControlPane.

/*
	 * Panes
	 */
private Pane createControlPane() {
    OutlinePane pane = new OutlinePane(0, 5, 9, 1, Priority.LOW);
    pane.setOrientation(HORIZONTAL);
    pane.setGap(3);
    pane.addItem(createController("MHF_ArrowLeft", this.messageService.getMessage(INVENTORY_ITEM_PALETTE_BACK_ITEM_NAME).first(), currentPage -> currentPage > 0, currentPage -> --currentPage));
    pane.addItem(createEnglishSearchItem());
    pane.addItem(createController("MHF_ArrowRight", this.messageService.getMessage(INVENTORY_ITEM_PALETTE_NEXT_ITEM_NAME).first(), currentPage -> currentPage < (this.itemsPane.getPages() - 1), currentPage -> ++currentPage));
    return pane;
}
Also used : Arrays(java.util.Arrays) GuiItem(com.github.stefvanschie.inventoryframework.gui.GuiItem) IntUnaryOperator(java.util.function.IntUnaryOperator) RewardService(dte.employme.job.rewards.service.RewardService) INVENTORY_ITEM_PALETTE_ENGLISH_SEARCH_ITEM_NAME(dte.employme.messages.MessageKey.INVENTORY_ITEM_PALETTE_ENGLISH_SEARCH_ITEM_NAME) Player(org.bukkit.entity.Player) Deque(java.util.Deque) IntPredicate(java.util.function.IntPredicate) SkullMeta(org.bukkit.inventory.meta.SkullMeta) Conversation(org.bukkit.conversations.Conversation) Collectors.toCollection(java.util.stream.Collectors.toCollection) Reward(dte.employme.job.rewards.Reward) INVENTORY_ITEM_PALETTE_NEXT_ITEM_NAME(dte.employme.messages.MessageKey.INVENTORY_ITEM_PALETTE_NEXT_ITEM_NAME) ConversationFactory(org.bukkit.conversations.ConversationFactory) HORIZONTAL(com.github.stefvanschie.inventoryframework.pane.Orientable.Orientation.HORIZONTAL) LinkedList(java.util.LinkedList) Material(org.bukkit.Material) Bukkit(org.bukkit.Bukkit) PaginatedPane(com.github.stefvanschie.inventoryframework.pane.PaginatedPane) OutlinePane(com.github.stefvanschie.inventoryframework.pane.OutlinePane) InventoryFrameworkUtils.createRectangle(dte.employme.utils.InventoryFrameworkUtils.createRectangle) ChestGui(com.github.stefvanschie.inventoryframework.gui.type.ChestGui) InventoryUtils.createWall(dte.employme.utils.InventoryUtils.createWall) Priority(com.github.stefvanschie.inventoryframework.pane.Pane.Priority) ItemStack(org.bukkit.inventory.ItemStack) MessageService(dte.employme.messages.service.MessageService) Collectors.toList(java.util.stream.Collectors.toList) List(java.util.List) JobGoalPrompt(dte.employme.job.prompts.JobGoalPrompt) ItemBuilder(dte.employme.utils.items.ItemBuilder) INVENTORY_ITEM_PALETTE_TITLE(dte.employme.messages.MessageKey.INVENTORY_ITEM_PALETTE_TITLE) Conversations(dte.employme.utils.Conversations) MaterialUtils(dte.employme.utils.MaterialUtils) MapBuilder(dte.employme.utils.java.MapBuilder) INVENTORY_ITEM_PALETTE_BACK_ITEM_NAME(dte.employme.messages.MessageKey.INVENTORY_ITEM_PALETTE_BACK_ITEM_NAME) Pane(com.github.stefvanschie.inventoryframework.pane.Pane) OutlinePane(com.github.stefvanschie.inventoryframework.pane.OutlinePane)

Example 2 with HORIZONTAL

use of com.github.stefvanschie.inventoryframework.pane.Orientable.Orientation.HORIZONTAL in project EmployMe by DavidTheExplorer.

the class JobCreationGUI method createOptionsPane.

private Pane createOptionsPane() {
    OutlinePane pane = new OutlinePane(2, 1, 6, 1, Priority.LOW);
    pane.setOrientation(HORIZONTAL);
    pane.setGap(3);
    // add the money job icon
    pane.addItem(new GuiItem(new ItemBuilder(Material.GOLD_INGOT).named(this.messageService.getMessage(INVENTORY_JOB_CREATION_MONEY_JOB_ICON_NAME).first()).withLore(this.messageService.getMessage(INVENTORY_JOB_CREATION_MONEY_JOB_ICON_LORE).toArray()).createCopy(), event -> {
        Player player = (Player) event.getWhoClicked();
        player.closeInventory();
        this.moneyJobConversationFactory.buildConversation(player).begin();
    }));
    // add the items job icon
    pane.addItem(new GuiItem(new ItemBuilder(Material.CHEST).named(this.messageService.getMessage(INVENTORY_JOB_CREATION_ITEMS_JOB_ICON_NAME).first()).withLore(this.messageService.getMessage(INVENTORY_JOB_CREATION_ITEMS_JOB_ICON_LORE).toArray()).createCopy(), event -> new ItemsRewardOfferGUI(this.jobBoard, this.messageService, this.playerContainerService, this.rewardService).show(event.getWhoClicked())));
    return pane;
}
Also used : INVENTORY_JOB_CREATION_MONEY_JOB_ICON_LORE(dte.employme.messages.MessageKey.INVENTORY_JOB_CREATION_MONEY_JOB_ICON_LORE) GuiItem(com.github.stefvanschie.inventoryframework.gui.GuiItem) RewardService(dte.employme.job.rewards.service.RewardService) Player(org.bukkit.entity.Player) PlayerContainerService(dte.employme.containers.service.PlayerContainerService) ConversationFactory(org.bukkit.conversations.ConversationFactory) INVENTORY_JOB_CREATION_TITLE(dte.employme.messages.MessageKey.INVENTORY_JOB_CREATION_TITLE) HORIZONTAL(com.github.stefvanschie.inventoryframework.pane.Orientable.Orientation.HORIZONTAL) INVENTORY_JOB_CREATION_MONEY_JOB_ICON_NAME(dte.employme.messages.MessageKey.INVENTORY_JOB_CREATION_MONEY_JOB_ICON_NAME) Material(org.bukkit.Material) OutlinePane(com.github.stefvanschie.inventoryframework.pane.OutlinePane) InventoryFrameworkUtils.createRectangle(dte.employme.utils.InventoryFrameworkUtils.createRectangle) Economy(net.milkbowl.vault.economy.Economy) ChestGui(com.github.stefvanschie.inventoryframework.gui.type.ChestGui) JobBoard(dte.employme.board.JobBoard) MoneyReward(dte.employme.job.rewards.MoneyReward) INVENTORY_JOB_CREATION_ITEMS_JOB_ICON_LORE(dte.employme.messages.MessageKey.INVENTORY_JOB_CREATION_ITEMS_JOB_ICON_LORE) InventoryUtils.createWall(dte.employme.utils.InventoryUtils.createWall) Priority(com.github.stefvanschie.inventoryframework.pane.Pane.Priority) MessageService(dte.employme.messages.service.MessageService) ItemBuilder(dte.employme.utils.items.ItemBuilder) Conversations(dte.employme.utils.Conversations) Pane(com.github.stefvanschie.inventoryframework.pane.Pane) INVENTORY_JOB_CREATION_ITEMS_JOB_ICON_NAME(dte.employme.messages.MessageKey.INVENTORY_JOB_CREATION_ITEMS_JOB_ICON_NAME) JobPaymentPrompt(dte.employme.job.prompts.JobPaymentPrompt) GuiItem(com.github.stefvanschie.inventoryframework.gui.GuiItem) ItemBuilder(dte.employme.utils.items.ItemBuilder) Player(org.bukkit.entity.Player) OutlinePane(com.github.stefvanschie.inventoryframework.pane.OutlinePane)

Aggregations

GuiItem (com.github.stefvanschie.inventoryframework.gui.GuiItem)2 ChestGui (com.github.stefvanschie.inventoryframework.gui.type.ChestGui)2 HORIZONTAL (com.github.stefvanschie.inventoryframework.pane.Orientable.Orientation.HORIZONTAL)2 OutlinePane (com.github.stefvanschie.inventoryframework.pane.OutlinePane)2 Pane (com.github.stefvanschie.inventoryframework.pane.Pane)2 Priority (com.github.stefvanschie.inventoryframework.pane.Pane.Priority)2 RewardService (dte.employme.job.rewards.service.RewardService)2 MessageService (dte.employme.messages.service.MessageService)2 Conversations (dte.employme.utils.Conversations)2 InventoryFrameworkUtils.createRectangle (dte.employme.utils.InventoryFrameworkUtils.createRectangle)2 InventoryUtils.createWall (dte.employme.utils.InventoryUtils.createWall)2 ItemBuilder (dte.employme.utils.items.ItemBuilder)2 Material (org.bukkit.Material)2 ConversationFactory (org.bukkit.conversations.ConversationFactory)2 Player (org.bukkit.entity.Player)2 PaginatedPane (com.github.stefvanschie.inventoryframework.pane.PaginatedPane)1 JobBoard (dte.employme.board.JobBoard)1 PlayerContainerService (dte.employme.containers.service.PlayerContainerService)1 JobGoalPrompt (dte.employme.job.prompts.JobGoalPrompt)1 JobPaymentPrompt (dte.employme.job.prompts.JobPaymentPrompt)1