Skip to content

Commit

Permalink
set text field on init
Browse files Browse the repository at this point in the history
  • Loading branch information
ghzdude committed Jan 19, 2024
1 parent 8282c92 commit a9fb241
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ protected ParentWidget<?> createUI(ModularPanel mainPanel, GuiSyncManager syncMa

var filterTransferSize = new StringSyncValue(this::getTransferAmountString, this::setStringTransferRate);
filterTransferSize.updateCacheFromSource(true);
var transferTextField = new TextFieldWidget().widthRel(0.5f).right(0);
transferTextField.setEnabled(this.fluidFilterContainer.showGlobalTransferLimitSlider() &&
this.voidingMode == VoidingMode.VOID_OVERFLOW);

return super.createUI(mainPanel, syncManager)
.child(new EnumRowBuilder<>(VoidingMode.class)
Expand All @@ -241,7 +244,7 @@ protected ParentWidget<?> createUI(ModularPanel mainPanel, GuiSyncManager syncMa
.value(bucketMode)
.overlay(IKey.str("kL"), IKey.str("L"))
.build()
.child(new TextFieldWidget().widthRel(0.5f).right(0)
.child(transferTextField
.setEnabledIf(w -> this.fluidFilterContainer.showGlobalTransferLimitSlider() &&
this.voidingMode == VoidingMode.VOID_OVERFLOW)
.setNumbers(0, Integer.MAX_VALUE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ protected ParentWidget<Column> createUI(ModularPanel mainPanel, GuiSyncManager g
() -> String.valueOf(this.itemFilterContainer.getTransferSize()),
s -> this.itemFilterContainer.setTransferSize(Integer.parseInt(s)));
filterTransferSize.updateCacheFromSource(true);
var transferTextField = new TextFieldWidget().widthRel(0.5f).right(0);
transferTextField.setEnabled(this.itemFilterContainer.showGlobalTransferLimitSlider() &&
this.voidingMode == VoidingMode.VOID_OVERFLOW);

return super.createUI(mainPanel, guiSyncManager)
.child(new EnumRowBuilder<>(VoidingMode.class)
Expand All @@ -201,7 +204,7 @@ protected ParentWidget<Column> createUI(ModularPanel mainPanel, GuiSyncManager g
// .overlay(GTGuiTextures.TRANSFER_MODE_OVERLAY) todo voiding mode overlay
.build())
.child(new Row().right(0).coverChildrenHeight()
.child(new TextFieldWidget().widthRel(0.5f).right(0)
.child(transferTextField
.setEnabledIf(w -> this.itemFilterContainer.showGlobalTransferLimitSlider() &&
this.voidingMode == VoidingMode.VOID_OVERFLOW)
.setNumbers(0, Integer.MAX_VALUE)
Expand All @@ -222,7 +225,7 @@ public void renderCover(CCRenderState renderState, Matrix4 translation, IVertexO

public void setVoidingMode(VoidingMode voidingMode) {
this.voidingMode = voidingMode;
this.itemFilterContainer.setMaxTransferSize(voidingMode.maxStackSize);
this.itemFilterContainer.setMaxTransferSize(getMaxStackSize());
this.getCoverableView().markDirty();
}

Expand Down

0 comments on commit a9fb241

Please sign in to comment.