mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-15 17:05:09 +01:00
feat: 'visibleButLocked' now applies for all buttons
This commit is contained in:
@@ -298,7 +298,7 @@ public abstract class MidnightConfig {
|
|||||||
if (entry.buttons.get(0) instanceof ClickableWidget widget)
|
if (entry.buttons.get(0) instanceof ClickableWidget widget)
|
||||||
if (widget.isFocused() || widget.isHovered()) widget.setTooltip(getTooltip(entry.info, true));
|
if (widget.isFocused() || widget.isHovered()) widget.setTooltip(getTooltip(entry.info, true));
|
||||||
if (entry.buttons.get(1) instanceof ButtonWidget button)
|
if (entry.buttons.get(1) instanceof ButtonWidget button)
|
||||||
button.active = !Objects.equals(String.valueOf(entry.info.value), String.valueOf(entry.info.defaultValue));
|
button.active = !Objects.equals(String.valueOf(entry.info.value), String.valueOf(entry.info.defaultValue)) && entry.info.conditionsMet;
|
||||||
}}}}
|
}}}}
|
||||||
@Override
|
@Override
|
||||||
public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
|
public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
|
||||||
@@ -415,7 +415,6 @@ public abstract class MidnightConfig {
|
|||||||
explorerButton.setPosition(width - 185, 0);
|
explorerButton.setPosition(width - 185, 0);
|
||||||
info.actionButton = explorerButton;
|
info.actionButton = explorerButton;
|
||||||
}
|
}
|
||||||
if (!info.conditionsMet) widget.active = false;
|
|
||||||
List<ClickableWidget> widgets = Lists.newArrayList(widget, resetButton);
|
List<ClickableWidget> widgets = Lists.newArrayList(widget, resetButton);
|
||||||
if (info.actionButton != null) {
|
if (info.actionButton != null) {
|
||||||
if (IS_SYSTEM_MAC) info.actionButton.active = false;
|
if (IS_SYSTEM_MAC) info.actionButton.active = false;
|
||||||
@@ -426,6 +425,7 @@ public abstract class MidnightConfig {
|
|||||||
widget.setWidth(widget.getWidth() - 22); widget.setX(widget.getX() + 22);
|
widget.setWidth(widget.getWidth() - 22); widget.setX(widget.getX() + 22);
|
||||||
widgets.add(cycleButton);
|
widgets.add(cycleButton);
|
||||||
}
|
}
|
||||||
|
if (!info.conditionsMet) widgets.forEach(w -> w.active = false);
|
||||||
this.list.addButton(widgets, name, info);
|
this.list.addButton(widgets, name, info);
|
||||||
} else this.list.addButton(List.of(), name, info);
|
} else this.list.addButton(List.of(), name, info);
|
||||||
} list.setScrollY(scrollProgress);
|
} list.setScrollY(scrollProgress);
|
||||||
|
|||||||
Reference in New Issue
Block a user