aboutsummaryrefslogtreecommitdiff
path: root/common/src/main/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java
diff options
context:
space:
mode:
authorisXander <xandersmith2008@gmail.com>2023-05-05 20:14:16 +0100
committerisXander <xandersmith2008@gmail.com>2023-05-05 20:14:16 +0100
commit5b368af9efcc1c587c608d014e9dc79bcc3c691c (patch)
tree7a98f1074f013dc58fd0ec52d808098df88c4b64 /common/src/main/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java
parent341bb7f507ee36d9727e17362559eaaa20e73b9b (diff)
downloadYetAnotherConfigLib-5b368af9efcc1c587c608d014e9dc79bcc3c691c.tar.gz
YetAnotherConfigLib-5b368af9efcc1c587c608d014e9dc79bcc3c691c.tar.bz2
YetAnotherConfigLib-5b368af9efcc1c587c608d014e9dc79bcc3c691c.zip
improve compat with controlify
Diffstat (limited to 'common/src/main/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java')
-rw-r--r--common/src/main/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/common/src/main/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java b/common/src/main/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java
index b955912..ac58db6 100644
--- a/common/src/main/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java
+++ b/common/src/main/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java
@@ -3,22 +3,20 @@ package dev.isxander.yacl.gui;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Font;
-import net.minecraft.client.gui.components.Button;
-import net.minecraft.client.gui.components.Tooltip;
+import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import net.minecraft.util.Mth;
-public class TextScaledButtonWidget extends Button {
+public class TextScaledButtonWidget extends TooltipButtonWidget {
public float textScale;
- public TextScaledButtonWidget(int x, int y, int width, int height, float textScale, Component message, OnPress onPress) {
- super(x, y, width, height, message, onPress, DEFAULT_NARRATION);
+ public TextScaledButtonWidget(Screen screen, int x, int y, int width, int height, float textScale, Component message, Component tooltip, OnPress onPress) {
+ super(screen, x, y, width, height, message, tooltip, onPress);
this.textScale = textScale;
}
- public TextScaledButtonWidget(int x, int y, int width, int height, float textScale, Component message, OnPress onPress, Tooltip tooltip) {
- this(x, y, width, height, textScale, message, onPress);
- setTooltip(tooltip);
+ public TextScaledButtonWidget(Screen screen, int x, int y, int width, int height, float textScale, Component message, OnPress onPress) {
+ this(screen, x, y, width, height, textScale, message, null, onPress);
}
@Override