Skip to content

Commit

Permalink
Add GUI trimming options per GUI type
Browse files Browse the repository at this point in the history
  • Loading branch information
AfkF24 authored and LMBishop committed Jan 24, 2024
1 parent b2918ae commit af1a539
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class QuestQMenu extends PaginatedQMenu {

public QuestQMenu(BukkitQuestsPlugin plugin, QPlayer owner, List<Quest> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class StartedQMenu extends PaginatedQMenu {

public StartedQMenu(BukkitQuestsPlugin plugin, QPlayer owner, List<Quest> 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<MenuElement> elements = new ArrayList<>();

Expand Down
5 changes: 4 additions & 1 deletion bukkit/src/main/resources/resources/bukkit/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion docs/configuration/basic-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit af1a539

Please sign in to comment.