Skip to content

Commit 622b1f6

Browse files
committed
improve tooltip a bit more
1 parent af88d73 commit 622b1f6

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

src/main/java/gregtech/common/metatileentities/multi/electric/MetaTileEntityHPCA.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
import com.cleanroommc.modularui.value.sync.IntSyncValue;
6161
import com.cleanroommc.modularui.value.sync.PanelSyncManager;
6262
import com.cleanroommc.modularui.widget.ParentWidget;
63+
import com.cleanroommc.modularui.widget.Widget;
6364
import com.cleanroommc.modularui.widgets.ProgressWidget;
6465
import com.cleanroommc.modularui.widgets.layout.Grid;
6566
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
@@ -367,28 +368,28 @@ protected MultiblockUIFactory createUIFactory() {
367368
.leftRel(0.5f)
368369
.bottom(5)
369370
.size(16 * 3 + 2)
371+
.child(new ProgressWidget()
372+
.sizeRel(1f)
373+
.value(new DoubleSyncValue(progressSupplier))
374+
.texture(GTGuiTextures.HPCA_COMPONENT_OUTLINE, 47)
375+
.direction(ProgressWidget.Direction.LEFT)
376+
.tooltipAutoUpdate(true))
370377
.child(new Grid()
371378
.sizeRel(1f)
372379
.padding(1)
373-
.minElementMargin(1)
374-
.mapTo(3, 9, value -> new DynamicDrawable(() -> hpcaHandler.getComponentTexture2(value))
375-
.asWidget()
380+
.mapTo(3, 9, value -> new Widget<>()
381+
.overlay(new DynamicDrawable(() -> hpcaHandler.getComponentTexture2(value))
382+
.asIcon().size(14).marginLeft(2).marginTop(2))
376383
.tooltipAutoUpdate(true)
377384
.tooltipBuilder(tooltip -> {
378-
hpcaHandler.addInfo(tooltip);
379385
if (isStructureFormed()) {
380386
tooltip.addLine(hpcaHandler.getComponentKey(value));
387+
tooltip.spaceLine(2);
381388
}
389+
hpcaHandler.addInfo(tooltip);
382390
})
383-
.size(14)))
384-
.child(new ProgressWidget()
385-
.sizeRel(1f)
386-
.value(new DoubleSyncValue(progressSupplier))
387-
.texture(GTGuiTextures.HPCA_COMPONENT_OUTLINE,
388-
47)
389-
.direction(ProgressWidget.Direction.LEFT)
390-
.tooltipAutoUpdate(true)
391-
.tooltipBuilder(hpcaHandler::addInfo))));
391+
.size(16)
392+
.padding(1)))));
392393
}
393394

394395
@Override

0 commit comments

Comments
 (0)