1
mirror of https://github.com/Shiewk/Widgets.git synced 2026-04-28 11:34:17 +02:00

Add option to set show condition on widget options

This commit is contained in:
Shy
2024-09-09 10:01:10 +02:00
parent c51c79286b
commit c61dca9533
3 changed files with 16 additions and 0 deletions
@@ -45,6 +45,7 @@ public class WidgetSettingsEditWidget extends ScrollableWidget {
context.getMatrices().pop();
int y = textRenderer.fontHeight * 2 + this.height / 50 + 5;
for (WidgetSettingOption setting : widget.getSettings().getCustomSettings()) {
if (!setting.shouldShow()) continue;
if (this.width - setting.getWidth() > textRenderer.getWidth(setting.getName()) + 20){
setting.setX(this.getX() + this.width - setting.getWidth() - 5);
setting.setY(y);