diff options
Diffstat (limited to 'common/src/main/java/dev/isxander/yacl3/gui')
-rw-r--r-- | common/src/main/java/dev/isxander/yacl3/gui/OptionListWidget.java | 4 | ||||
-rw-r--r-- | common/src/main/java/dev/isxander/yacl3/gui/controllers/ListEntryWidget.java | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/common/src/main/java/dev/isxander/yacl3/gui/OptionListWidget.java b/common/src/main/java/dev/isxander/yacl3/gui/OptionListWidget.java index 54d58f4..3197c44 100644 --- a/common/src/main/java/dev/isxander/yacl3/gui/OptionListWidget.java +++ b/common/src/main/java/dev/isxander/yacl3/gui/OptionListWidget.java @@ -485,7 +485,7 @@ public class OptionListWidget extends ElementListWidgetExt<OptionListWidget.Entr this.addListButton = new TooltipButtonWidget(yaclScreen, resetListButton.getX() - 20, -50, 20, 20, Component.literal("+"), Component.translatable("yacl.list.add_top"), btn -> { - group.insertNewEntryToTop(); + group.insertNewEntry(); setExpanded(true); }); @@ -519,7 +519,7 @@ public class OptionListWidget extends ElementListWidgetExt<OptionListWidget.Entr super.updateExpandMinimizeText(); expandMinimizeButton.active = listOption == null || listOption.available(); if (addListButton != null) - addListButton.active = expandMinimizeButton.active; + addListButton.active = expandMinimizeButton.active && listOption.numberOfEntries() < listOption.maximumNumberOfEntries(); } @Override diff --git a/common/src/main/java/dev/isxander/yacl3/gui/controllers/ListEntryWidget.java b/common/src/main/java/dev/isxander/yacl3/gui/controllers/ListEntryWidget.java index 15deff2..7e71cc7 100644 --- a/common/src/main/java/dev/isxander/yacl3/gui/controllers/ListEntryWidget.java +++ b/common/src/main/java/dev/isxander/yacl3/gui/controllers/ListEntryWidget.java @@ -80,7 +80,7 @@ public class ListEntryWidget extends AbstractWidget implements ContainerEventHan } protected void updateButtonStates() { - removeButton.active = listOption.available(); + removeButton.active = listOption.available() && listOption.numberOfEntries() > listOption.minimumNumberOfEntries(); moveUpButton.active = listOption.indexOf(listOptionEntry) > 0 && listOption.available(); moveDownButton.active = listOption.indexOf(listOptionEntry) < listOption.options().size() - 1 && listOption.available(); } |