Skip to content

Commit

Permalink
fix to booleanButtonWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
megadoxs committed Jul 17, 2024
1 parent 51aeede commit 712fe53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public class UserInterface extends Screen {
private final Size size;

private final ScreenElementFactory.Instance screenElements;

// can't I just make a function for widget to add themselves here so when creating them? could make display and button set their value when creating.
private final ArrayList<Widget> widgets = new ArrayList<>();
//private MegalibWidgetVisibility widget; // has planned used in future

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public class MegalibBooleanButtonWidget extends MegalibButtonWidget{
private boolean value;
private final Text message;

protected MegalibBooleanButtonWidget(int x, int y, int width, int height, Text message, PressAction onPress, NarrationSupplier narrationSupplier) {
super(x, y, width, height, Text.of(message.getString() + ": false"), onPress, narrationSupplier);
protected MegalibBooleanButtonWidget(int x, int y, int width, int height, Text message, PressAction onPress) {
super(x, y, width, height, Text.of(message.getString() + ": false"), onPress);
value = false;
this.message = message;
}
Expand Down Expand Up @@ -43,10 +43,8 @@ public static class Builder {
private int y;
private int width = 150;
private int height = 20;
private NarrationSupplier narrationSupplier;

public Builder(Text message, PressAction onPress) {
this.narrationSupplier = ButtonWidget.DEFAULT_NARRATION_SUPPLIER;
this.message = message;
this.onPress = onPress;
}
Expand Down Expand Up @@ -77,13 +75,8 @@ public MegalibBooleanButtonWidget.Builder tooltip(@Nullable Tooltip tooltip) {
return this;
}

public MegalibBooleanButtonWidget.Builder narrationSupplier(NarrationSupplier narrationSupplier) {
this.narrationSupplier = narrationSupplier;
return this;
}

public MegalibBooleanButtonWidget build() {
MegalibBooleanButtonWidget megalibBooleanButtonWidgetWidget = new MegalibBooleanButtonWidget(this.x, this.y, this.width, this.height, this.message, this.onPress, this.narrationSupplier);
MegalibBooleanButtonWidget megalibBooleanButtonWidgetWidget = new MegalibBooleanButtonWidget(this.x, this.y, this.width, this.height, this.message, this.onPress);
megalibBooleanButtonWidgetWidget.setTooltip(this.tooltip);
return megalibBooleanButtonWidgetWidget;
}
Expand Down

0 comments on commit 712fe53

Please sign in to comment.