Skip to content

Commit 2afb160

Browse files
committed
Added a "Buttons per Row" option.
1 parent 8da04d2 commit 2afb160

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/java/xyz/imcodist/other/ModConfigModel.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ public enum DisplayRunText {
1818
@RangeConstraint(min = 60, max = 150*3)
1919
public int menuHeight = 114;
2020

21+
@RangeConstraint(min = 1, max = 14)
22+
public int buttonsPerRow = 5;
23+
2124
public boolean closeOnKeyReleased = false;
2225

2326
public boolean hideEditIcon = false;

src/main/java/xyz/imcodist/ui/MainUI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ private void createActionButtons(FlowLayout parent) {
150150
double actionsCount = ActionButtonDataHandler.actions.size();
151151

152152
int curAction = 0;
153-
double rowSize = 5;
153+
double rowSize = QuickMenu.CONFIG.buttonsPerRow();
154154

155155
if (actionsCount > 0) {
156156
for (int y = 0; y < Math.ceil(actionsCount / rowSize); y++) {

src/main/resources/assets/quickmenu/lang/en_us.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
"text.config.quickmenu.option.menuWidth": "Menu Width",
3333
"text.config.quickmenu.option.menuHeight": "Menu Height",
34+
"text.config.quickmenu.option.buttonsPerRow": "Buttons per Row",
3435
"text.config.quickmenu.option.closeOnAction": "Close on Action",
3536
"text.config.quickmenu.option.closeOnKeyReleased": "Close on Key Released",
3637
"text.config.quickmenu.option.hideEditIcon": "Hide Edit Icon",

0 commit comments

Comments
 (0)