Skip to content

Commit 7938d5b

Browse files
committed
properly disable background
1 parent a5f0b7a commit 7938d5b

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/main/java/gregtech/common/mui/widget/GTFluidSlot.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import com.cleanroommc.modularui.api.ITheme;
1212
import com.cleanroommc.modularui.api.UpOrDown;
13+
import com.cleanroommc.modularui.api.drawable.IDrawable;
1314
import com.cleanroommc.modularui.api.widget.Interactable;
1415
import com.cleanroommc.modularui.drawable.GuiDraw;
1516
import com.cleanroommc.modularui.drawable.text.TextRenderer;
@@ -32,7 +33,6 @@ public final class GTFluidSlot extends Widget<GTFluidSlot> implements Interactab
3233

3334
private final TextRenderer textRenderer = new TextRenderer();
3435
private GTFluidSyncHandler syncHandler;
35-
private boolean disableBackground = false;
3636

3737
public GTFluidSlot() {
3838
tooltip().titleMargin();
@@ -65,21 +65,14 @@ public GTFluidSlot syncHandler(GTFluidSyncHandler syncHandler) {
6565
}
6666

6767
public GTFluidSlot disableBackground() {
68-
this.disableBackground = true;
69-
return this;
68+
return background(IDrawable.NONE);
7069
}
7170

7271
@Override
7372
public boolean isValidSyncHandler(SyncHandler syncHandler) {
7473
return syncHandler instanceof GTFluidSyncHandler;
7574
}
7675

77-
@Override
78-
public void drawBackground(ModularGuiContext context, WidgetThemeEntry<?> widgetTheme) {
79-
if (disableBackground) return;
80-
super.drawBackground(context, widgetTheme);
81-
}
82-
8376
@Override
8477
public void draw(ModularGuiContext context, WidgetThemeEntry<?> widgetTheme) {
8578
FluidStack content = this.syncHandler.getFluid();

0 commit comments

Comments
 (0)