Skip to content

Commit

Permalink
Added a "Buttons per Row" option.
Browse files Browse the repository at this point in the history
  • Loading branch information
ImCodist committed Oct 6, 2023
1 parent 8da04d2 commit 2afb160
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/main/java/xyz/imcodist/other/ModConfigModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public enum DisplayRunText {
@RangeConstraint(min = 60, max = 150*3)
public int menuHeight = 114;

@RangeConstraint(min = 1, max = 14)
public int buttonsPerRow = 5;

public boolean closeOnKeyReleased = false;

public boolean hideEditIcon = false;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/xyz/imcodist/ui/MainUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private void createActionButtons(FlowLayout parent) {
double actionsCount = ActionButtonDataHandler.actions.size();

int curAction = 0;
double rowSize = 5;
double rowSize = QuickMenu.CONFIG.buttonsPerRow();

if (actionsCount > 0) {
for (int y = 0; y < Math.ceil(actionsCount / rowSize); y++) {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/quickmenu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

"text.config.quickmenu.option.menuWidth": "Menu Width",
"text.config.quickmenu.option.menuHeight": "Menu Height",
"text.config.quickmenu.option.buttonsPerRow": "Buttons per Row",
"text.config.quickmenu.option.closeOnAction": "Close on Action",
"text.config.quickmenu.option.closeOnKeyReleased": "Close on Key Released",
"text.config.quickmenu.option.hideEditIcon": "Hide Edit Icon",
Expand Down

0 comments on commit 2afb160

Please sign in to comment.