From af1a539c75a0fa70b7d7fd554e5a5f6c9db6d447 Mon Sep 17 00:00:00 2001 From: AfkF24 Date: Thu, 18 Jan 2024 13:36:05 +0100 Subject: [PATCH] Add GUI trimming options per GUI type --- .../com/leonardobishop/quests/bukkit/menu/CategoryQMenu.java | 2 +- .../com/leonardobishop/quests/bukkit/menu/QuestQMenu.java | 2 +- .../com/leonardobishop/quests/bukkit/menu/StartedQMenu.java | 2 +- bukkit/src/main/resources/resources/bukkit/config.yml | 5 ++++- docs/configuration/basic-options.md | 5 ++++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/CategoryQMenu.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/CategoryQMenu.java index dbd15a259..9223bc193 100644 --- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/CategoryQMenu.java +++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/CategoryQMenu.java @@ -21,7 +21,7 @@ public class CategoryQMenu extends PaginatedQMenu { public CategoryQMenu(BukkitQuestsPlugin plugin, QPlayer owner) { super(owner, Chat.legacyColor(plugin.getQuestsConfig().getString("options.guinames.quests-category")), - plugin.getQuestsConfig().getBoolean("options.trim-gui-size"), 54, plugin); + plugin.getQuestsConfig().getBoolean("options.trim-gui-size.quests-category-menu"), 54, plugin); BukkitQuestsConfig config = (BukkitQuestsConfig) plugin.getQuestsConfig(); diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/QuestQMenu.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/QuestQMenu.java index 729c06f79..c85e08e92 100644 --- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/QuestQMenu.java +++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/QuestQMenu.java @@ -24,7 +24,7 @@ public class QuestQMenu extends PaginatedQMenu { public QuestQMenu(BukkitQuestsPlugin plugin, QPlayer owner, List quests, String categoryName, CategoryQMenu categoryQMenu) { super(owner, Chat.legacyColor(plugin.getQuestsConfig().getString("options.guinames.quests-menu")), - plugin.getQuestsConfig().getBoolean("options.trim-gui-size"), 54, plugin); + plugin.getQuestsConfig().getBoolean("options.trim-gui-size.quests-menu"), 54, plugin); BukkitQuestsConfig config = (BukkitQuestsConfig) plugin.getQuestsConfig(); this.categoryName = categoryName; diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/StartedQMenu.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/StartedQMenu.java index 3e5a57e01..0f64a5d39 100644 --- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/StartedQMenu.java +++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/StartedQMenu.java @@ -17,7 +17,7 @@ public class StartedQMenu extends PaginatedQMenu { public StartedQMenu(BukkitQuestsPlugin plugin, QPlayer owner, List quests) { super(owner, Chat.legacyColor(plugin.getQuestsConfig().getString("options.guinames.quests-started-menu")), - plugin.getQuestsConfig().getBoolean("options.trim-gui-size"), 54, plugin); + plugin.getQuestsConfig().getBoolean("options.trim-gui-size.quests-started-menu"), 54, plugin); List elements = new ArrayList<>(); diff --git a/bukkit/src/main/resources/resources/bukkit/config.yml b/bukkit/src/main/resources/resources/bukkit/config.yml index 5bf689daf..8a9d3e458 100644 --- a/bukkit/src/main/resources/resources/bukkit/config.yml +++ b/bukkit/src/main/resources/resources/bukkit/config.yml @@ -33,7 +33,10 @@ options: # If categories are disabled, quests will be put into one big gui. categories-enabled: true # If true, the gui size will automatically change based on the amount of quests inside it. - trim-gui-size: true + trim-gui-size: + quests-category-menu: true + quests-menu: true + quests-started-menu: true # Enable/disable titles titles-enabled: true # Enable/disable BossBars diff --git a/docs/configuration/basic-options.md b/docs/configuration/basic-options.md index 0a2dbdc04..6b461d4f1 100644 --- a/docs/configuration/basic-options.md +++ b/docs/configuration/basic-options.md @@ -54,7 +54,10 @@ of rows) so that there are not any empty rows. ``` yaml options: # ... - trim-gui-size: true + trim-gui-size: + quests-category-menu: true + quests-menu: true + quests-started-menu: true ``` ## Titles enabled