Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/main/java/com/cleanroommc/modularui/test/TestTile.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,15 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager syncManager, UI
.reverseLayout(false)
.child(new ToggleButton()
.valueWrapped(cycleStateValue, 0)
.tooltipBuilder(false, t -> {
t.addLine("Wow! This button sure isnt selected! Not one bit!");
if (!this.oversizedStorage.getStackInSlot(this.cycleState).isEmpty()) {
t.addLine("Here is a cool item: ");
t.add(new ItemDrawable(this.oversizedStorage.getStackInSlot(this.cycleState)));
}
})
.tooltipBuilder(true, t -> t.addLine("Wow! This button IS selected! How cool!"))
.tooltipAutoUpdate(true)
.overlay(GuiTextures.CYCLE_BUTTON_DEMO.getSubArea(0, 0, 1, 1 / 3f)))
.child(new ToggleButton()
.valueWrapped(cycleStateValue, 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,22 @@ public W tooltipShowUpTimer(int showUpTimer) {
return getThis();
}

/**
* Sets the tooltip auto update value for all states.
*
* @param update true if tooltips should automatically update
* @return this
*/
@Override
public W tooltipAutoUpdate(boolean update) {
super.tooltipAutoUpdate(update);
expectCount();
for (RichTooltip tooltip : this.tooltip) {
tooltip.setAutoUpdate(update);
}
return getThis();
}

Comment thread
brachy84 marked this conversation as resolved.
protected W stateCount(int stateCount) {
updateStateCount(stateCount, true);
return getThis();
Expand Down