diff options
Diffstat (limited to 'src/me/fatpigsarefat/quests/obj')
| -rw-r--r-- | src/me/fatpigsarefat/quests/obj/Messages.java | 2 | ||||
| -rw-r--r-- | src/me/fatpigsarefat/quests/obj/Options.java | 3 | ||||
| -rw-r--r-- | src/me/fatpigsarefat/quests/obj/misc/creator/QMenuCreator.java | 70 |
3 files changed, 74 insertions, 1 deletions
diff --git a/src/me/fatpigsarefat/quests/obj/Messages.java b/src/me/fatpigsarefat/quests/obj/Messages.java index 1b81bf0e..ddcb23cb 100644 --- a/src/me/fatpigsarefat/quests/obj/Messages.java +++ b/src/me/fatpigsarefat/quests/obj/Messages.java @@ -7,10 +7,12 @@ public enum Messages { QUEST_START("messages.quest-start"), QUEST_COMPLETE("messages.quest-complete"), + QUEST_CANCEL("messages.quest-cancel"), QUEST_START_LIMIT("messages.quest-start-limit"), QUEST_START_DISABLED("messages.quest-start-disabled"), QUEST_START_LOCKED("messages.quest-start-locked"), QUEST_START_COOLDOWN("messages.quest-start-cooldown"), + QUEST_CANCEL_NOTSTARTED("messages.quest-cancel-notstarted"), QUEST_UPDATER("messages.quest-updater"), COMMAND_QUEST_START_DOESNTEXIST("messages.command-quest-start-doesntexist"), COMMAND_QUEST_OPENCATEGORY_ADMIN_SUCCESS("messages.command-quest-opencategory-admin-success"), diff --git a/src/me/fatpigsarefat/quests/obj/Options.java b/src/me/fatpigsarefat/quests/obj/Options.java index 56d4e7e3..920f1132 100644 --- a/src/me/fatpigsarefat/quests/obj/Options.java +++ b/src/me/fatpigsarefat/quests/obj/Options.java @@ -15,7 +15,8 @@ public enum Options { GUI_HIDE_LOCKED("options.gui-hide-locked"), GUITITLE_QUESTS_CATEGORY("options.guinames.quests-category"), GUITITLE_QUESTS("options.guinames.quests-menu"), - GUITITLE_DAILY_QUESTS("options.guinames.daily-quests"); + GUITITLE_DAILY_QUESTS("options.guinames.daily-quests"), + ALLOW_QUEST_CANCEL("options.allow-quest-cancel"); private String path; diff --git a/src/me/fatpigsarefat/quests/obj/misc/creator/QMenuCreator.java b/src/me/fatpigsarefat/quests/obj/misc/creator/QMenuCreator.java new file mode 100644 index 00000000..0436e203 --- /dev/null +++ b/src/me/fatpigsarefat/quests/obj/misc/creator/QMenuCreator.java @@ -0,0 +1,70 @@ +package me.fatpigsarefat.quests.obj.misc.creator; + +import me.fatpigsarefat.quests.obj.misc.QMenu; +import me.fatpigsarefat.quests.player.QPlayer; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +public class QMenuCreator implements QMenu { + + private QPlayer owner; + + public QMenuCreator(QPlayer owner) { + this.owner = owner; + } + + @Override + public HashMap<Integer, String> getSlotsToMenu() { + return null; + } + + @Override + public QPlayer getOwner() { + return owner; + } + + public Inventory toInventory(int page) { + String title = "Quest Creator"; + + Inventory inventory = Bukkit.createInventory(null, 9, title); + + ItemStack newQuest = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short) 5); + ItemMeta newQuestM = newQuest.getItemMeta(); + List<String> newQuestL = new ArrayList<>(); + newQuestM.setDisplayName(ChatColor.GREEN.toString() + ChatColor.BOLD + "New Quest"); + newQuestL.add(ChatColor.GRAY + "Click to make a new quest."); + newQuestM.setLore(newQuestL); + newQuest.setItemMeta(newQuestM); + + ItemStack editQuest = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short) 1); + ItemMeta editQuestM = editQuest.getItemMeta(); + List<String> editQuestL = new ArrayList<>(); + editQuestM.setDisplayName(ChatColor.GREEN.toString() + ChatColor.BOLD + "Edit Quest"); + editQuestL.add(ChatColor.GRAY + "Click to edit an existing quest."); + editQuestM.setLore(editQuestL); + editQuest.setItemMeta(editQuestM); + + ItemStack removeQuest = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short) 14); + ItemMeta removeQuestM = removeQuest.getItemMeta(); + List<String> removeQuestL = new ArrayList<>(); + removeQuestM.setDisplayName(ChatColor.GREEN.toString() + ChatColor.BOLD + "Delete Quest"); + removeQuestL.add(ChatColor.GRAY + "Click to delete an existing quest."); + removeQuestM.setLore(removeQuestL); + removeQuest.setItemMeta(removeQuestM); + + inventory.setItem(2, newQuest); + inventory.setItem(4, editQuest); + inventory.setItem(6, removeQuest); + + return inventory; + } + +} |
