mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-15 09:05:08 +01:00
fix bug: the @Condition does not trigger in real-time to update the menu UI
This commit is contained in:
@@ -163,7 +163,9 @@ public abstract class MidnightConfig {
|
||||
};
|
||||
info.function = new AbstractMap.SimpleEntry<ButtonWidget.PressAction, Function<Object, Text>>(button -> {
|
||||
int index = values.indexOf(info.value) + 1;
|
||||
info.value = values.get(index >= values.size() ? 0 : index); button.setMessage(func.apply(info.value));
|
||||
//info.value = values.get(index >= values.size() ? 0 : index); button.setMessage(func.apply(info.value));
|
||||
info.setValue(values.get(index >= values.size() ? 0 : index));
|
||||
button.setMessage(func.apply(info.value));
|
||||
}, func);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user