Skip to content

Commit

Permalink
Configurable gui sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSzabo committed Aug 14, 2024
1 parent 2752fcb commit 856e25c
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class CategoriesMenuConfig extends AuroraConfig {
private FillerItem filler;
private Map<String, ItemConfig> items;
private Map<String, ItemConfig> customItems;
private Integer rows = 6;

@Getter
public static final class FillerItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class CategoryRewardsMenuConfig extends AuroraConfig {
private Map<String, DisplayComponent> displayComponents;
private List<Integer> displayArea;
private Items items;
private Integer rows = 6;

public CategoryRewardsMenuConfig(AuroraCollections plugin) {
super(getFile(plugin));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class CollectionListMenuConfig extends AuroraConfig {
private Map<String, ItemConfig> customItems;
private List<Integer> displayArea;
private Items items;
private Integer rows = 6;

@Getter
public static final class Items {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class CollectionMenuConfig extends AuroraConfig {
private Boolean allowItemAmounts = false;
private Boolean forceRomanNumerals = false;
private ItemTemplate collectionMenuTemplate;
private Integer rows = 6;

public CollectionMenuConfig(AuroraCollections plugin) {
super(getFile(plugin));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void open() {
private AuroraMenu createMenu() {
var config = plugin.getConfigManager().getCategoriesMenuConfig();

var menu = new AuroraMenu(player, config.getTitle(), 54, false, menuId);
var menu = new AuroraMenu(player, config.getTitle(), config.getRows() * 9, false, menuId);

if (config.getFiller().getEnabled()) {
menu.addFiller(ItemBuilder.of(config.getFiller().getItem()).toItemStack(player));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private AuroraMenu createMenu() {
var config = plugin.getConfigManager().getCategoryRewardsMenuConfig();
var cf = plugin.getConfigManager().getCategoriesConfig().getCategories().get(category);

var menu = new AuroraMenu(player, config.getTitle(), 54, false, menuId,
var menu = new AuroraMenu(player, config.getTitle(), config.getRows() * 9, false, menuId,
Placeholder.of("{category_name}", cf.getName())
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private AuroraMenu createMenu() {
var cConfig = plugin.getConfigManager().getCollectionMenuConfig();
var categories = plugin.getConfigManager().getCategoriesConfig().getCategories();

var menu = new AuroraMenu(player, config.getTitle(), 54, false, menuId, Placeholder.of("{category}", categories.get(category).getName()));
var menu = new AuroraMenu(player, config.getTitle(), config.getRows() * 9, false, menuId, Placeholder.of("{category}", categories.get(category).getName()));

if (config.getItems().getFiller().getEnabled()) {
menu.addFiller(ItemBuilder.of(config.getItems().getFiller().getItem()).toItemStack(player));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void open() {
private AuroraMenu createMenu() {
var config = plugin.getConfigManager().getCollectionMenuConfig();

var menu = new AuroraMenu(player, config.getTitle(), 54, false, menuId,
var menu = new AuroraMenu(player, config.getTitle(), config.getRows() * 9, false, menuId,
Placeholder.of("{collection_name}", collection.getConfig().getName()),
Placeholder.of("{collection_title}", collection.getMenuTitle())
);
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/menus/categories.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
title: "Collections"

rows: 6

filler:
enabled: true
item:
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/menus/category_rewards.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
title: "{category_name} rewards"

rows: 6

display-area: [
# 10, 11, 12, 13, 14, 15, 16,
19, 20, 21, 22, 23, 24, 25,
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/menus/collection.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
title: "{collection_name} collection"

rows: 6

# If every one of your collection have less than 64 levels, then you can set this to true
# This will set item amounts to the level in the menu
allow-item-amounts: true
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/menus/collection_list.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
title: "{category} collections"

rows: 6

display-area: [
10, 11, 12, 13, 14, 15, 16,
19, 20, 21, 22, 23, 24, 25,
Expand Down

0 comments on commit 856e25c

Please sign in to comment.