Skip to content

Commit 69bc466

Browse files
authored
Make tank widgets able to display the contents of the tank in the tooltip separately from the overlay (GregTechCEu#3221)
Co-authored-by: GirixK <[email protected]>
1 parent 868e48c commit 69bc466

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/main/java/com/gregtechceu/gtceu/api/gui/widget/TankWidget.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ public class TankWidget extends Widget implements IRecipeIngredientSlot, IConfig
112112
protected int lastTankCapacity;
113113
@Setter
114114
protected Runnable changeListener;
115+
@Setter
116+
protected boolean showAmountOverlay = true;
115117

116118
public TankWidget() {
117119
this(null, 0, 0, 18, 18, true, true);
@@ -388,7 +390,7 @@ public void drawInBackground(@NotNull GuiGraphics graphics, int mouseX, int mous
388390
((int) (width * drawnWidth)), ((int) (height * drawnHeight)));
389391
}
390392

391-
if (showAmount && !renderedFluid.isEmpty()) {
393+
if (showAmount && showAmountOverlay && !renderedFluid.isEmpty()) {
392394
graphics.pose().pushPose();
393395
graphics.pose().scale(0.5F, 0.5F, 1);
394396
String s = TextFormattingUtil.formatLongToCompactStringBuckets(renderedFluid.getAmount(), 3) + "B";

src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/primitive/CokeOvenMachine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public ModularUI createUI(Player entityPlayer) {
5050
.widget(new TankWidget(exportFluids.getStorages()[0], 134, 13, 20, 58, true, false)
5151
.setBackground(GuiTextures.PRIMITIVE_LARGE_FLUID_TANK)
5252
.setFillDirection(ProgressTexture.FillDirection.DOWN_TO_UP)
53-
.setShowAmount(false)
53+
.setShowAmountOverlay(false)
5454
.setOverlay(GuiTextures.PRIMITIVE_LARGE_FLUID_TANK_OVERLAY))
5555
.widget(UITemplate.bindPlayerInventory(entityPlayer.getInventory(), GuiTextures.PRIMITIVE_SLOT, 7, 84,
5656
true));

0 commit comments

Comments
 (0)