Fixed settings screen crash

This commit is contained in:
Sollace 2024-07-22 00:25:06 +02:00
parent 75f26ce061
commit 90a5ac34fd
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -136,10 +136,11 @@ public class PonySettingsScreen extends GameGui {
if (hiddenOptions) {
for (Setting<?> i : config.getCategory("customisation").entries()) {
Button button = content
.addButton(new Toggle(LEFT, row += 20, ((Setting<Boolean>)i).get()))
.onChange((Setting<Boolean>)i);
button.getStyle().setText(OPTIONS_PREFIX + i.name().toLowerCase());
if (i.get() instanceof Boolean value) {
content.addButton(new Toggle(LEFT, row += 20, value))
.onChange((Setting<Boolean>)i)
.getStyle().setText(OPTIONS_PREFIX + i.name().toLowerCase());
}
}
}