diff options
Diffstat (limited to 'src/main/java/dev/isxander/yacl3/gui/TooltipButtonWidget.java')
-rw-r--r-- | src/main/java/dev/isxander/yacl3/gui/TooltipButtonWidget.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/dev/isxander/yacl3/gui/TooltipButtonWidget.java b/src/main/java/dev/isxander/yacl3/gui/TooltipButtonWidget.java new file mode 100644 index 0000000..f439301 --- /dev/null +++ b/src/main/java/dev/isxander/yacl3/gui/TooltipButtonWidget.java @@ -0,0 +1,21 @@ +package dev.isxander.yacl3.gui; + +import net.minecraft.client.gui.components.Button; +import net.minecraft.client.gui.components.Tooltip; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipPositioner; +import net.minecraft.network.chat.Component; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class TooltipButtonWidget extends Button { + + protected final Screen screen; + + public TooltipButtonWidget(Screen screen, int x, int y, int width, int height, Component message, Component tooltip, OnPress onPress) { + super(x, y, width, height, message, onPress, DEFAULT_NARRATION); + this.screen = screen; + if (tooltip != null) + setTooltip(new YACLTooltip(tooltip, this)); + } +} |