Skip to content

Commit 1fda908

Browse files
committed
make drawing item count configurable
1 parent e5adb8a commit 1fda908

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumChest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ protected void createWidgets(ModularPanel mainPanel, PanelSyncManager syncManage
319319
() -> TextFormattingUtil.formatNumbers(itemsStoredInside)))
320320
.child(new GTItemSlot()
321321
.showTooltip(false)
322+
.showAmount(false)
322323
.background(IDrawable.NONE)
323324
.slot(new ModularSlot(itemInventory, 0)
324325
.accessibility(false, false))

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class GTItemSlot extends Widget<GTItemSlot>
3232
JeiIngredientProvider {
3333

3434
private boolean showTooltip = true;
35+
private boolean showAmount = true;
3536
private ItemSlotSH syncHandler;
3637

3738
public GTItemSlot() {
@@ -59,6 +60,11 @@ public GTItemSlot showTooltip(boolean showTooltip) {
5960
return getThis();
6061
}
6162

63+
public GTItemSlot showAmount(boolean showAmount) {
64+
this.showAmount = showTooltip;
65+
return getThis();
66+
}
67+
6268
@SuppressWarnings("UnstableApiUsage")
6369
public GTItemSlot slot(ModularSlot slot) {
6470
this.syncHandler = new ItemSlotSH(slot);
@@ -131,7 +137,7 @@ public void drawForeground(ModularGuiContext context) {
131137
public void draw(ModularGuiContext context, WidgetTheme widgetTheme) {
132138
if (this.syncHandler == null) return;
133139

134-
RenderUtil.drawItemStack(getSlot().getStack(), 1, 1, false);
140+
RenderUtil.drawItemStack(getSlot().getStack(), 1, 1, showAmount);
135141

136142
if (isHovering()) {
137143
GlStateManager.colorMask(true, true, true, false);

0 commit comments

Comments
 (0)