2022-11-08 15:39:09 +01:00
|
|
|
package zone.oat.gmodtitlescreen;
|
|
|
|
|
|
|
|
import net.fabricmc.api.EnvType;
|
|
|
|
import net.fabricmc.api.Environment;
|
|
|
|
import net.minecraft.client.font.TextRenderer;
|
2023-03-28 19:21:41 +02:00
|
|
|
import net.minecraft.client.gui.tooltip.Tooltip;
|
2022-11-08 15:39:09 +01:00
|
|
|
import net.minecraft.client.gui.widget.PressableTextWidget;
|
|
|
|
import net.minecraft.text.Text;
|
|
|
|
|
|
|
|
@Environment(EnvType.CLIENT)
|
|
|
|
public class PressableTextWithTooltipWidget extends PressableTextWidget {
|
2023-03-28 19:21:41 +02:00
|
|
|
protected final Tooltip tooltip;
|
2022-11-08 15:39:09 +01:00
|
|
|
|
2023-03-28 19:21:41 +02:00
|
|
|
public PressableTextWithTooltipWidget(int x, int y, int width, int height, Text text, PressAction onPress, TextRenderer textRenderer, Tooltip tooltip) {
|
2022-11-08 15:39:09 +01:00
|
|
|
super(x, y, width, height, text, onPress, textRenderer);
|
2023-03-28 19:21:41 +02:00
|
|
|
this.tooltip = tooltip;
|
|
|
|
setTooltip(tooltip);
|
2022-11-08 15:39:09 +01:00
|
|
|
}
|
|
|
|
}
|