aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/dev/isxander/yacl/api/Option.java3
-rw-r--r--src/main/java/dev/isxander/yacl/gui/YACLScreen.java2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/dev/isxander/yacl/api/Option.java b/src/main/java/dev/isxander/yacl/api/Option.java
index 1c3b006..b17743e 100644
--- a/src/main/java/dev/isxander/yacl/api/Option.java
+++ b/src/main/java/dev/isxander/yacl/api/Option.java
@@ -97,6 +97,9 @@ public interface Option<T> {
*/
void requestSetDefault();
+ /**
+ * Adds a listener for when the pending value changes
+ */
void addListener(BiConsumer<Option<T>, T> changedListener);
/**
diff --git a/src/main/java/dev/isxander/yacl/gui/YACLScreen.java b/src/main/java/dev/isxander/yacl/gui/YACLScreen.java
index fc3984d..cef8fec 100644
--- a/src/main/java/dev/isxander/yacl/gui/YACLScreen.java
+++ b/src/main/java/dev/isxander/yacl/gui/YACLScreen.java
@@ -142,7 +142,7 @@ public class YACLScreen extends Screen {
}
public void changeCategory(int idx) {
- if (currentCategoryIdx != -1 && config.categories().get(idx) instanceof PlaceholderCategory placeholderCategory) {
+ if (idx != -1 && config.categories().get(idx) instanceof PlaceholderCategory placeholderCategory) {
client.setScreen(placeholderCategory.screen().apply(client, this));
} else {
currentCategoryIdx = idx;