aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java
diff options
context:
space:
mode:
authorisXander <xandersmith2008@gmail.com>2022-11-17 17:18:19 +0000
committerisXander <xandersmith2008@gmail.com>2022-11-17 17:18:19 +0000
commit3a86e9d2ba89466f7f9ef51c29eb5879bcb8a98e (patch)
treed3617930fed50a945ce4ff9ee76b8dbd7df46968 /src/main/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java
parentaf4484ecee46300a26952b9b9b41e7a2e80d3f78 (diff)
downloadYetAnotherConfigLib-3a86e9d2ba89466f7f9ef51c29eb5879bcb8a98e.tar.gz
YetAnotherConfigLib-3a86e9d2ba89466f7f9ef51c29eb5879bcb8a98e.tar.bz2
YetAnotherConfigLib-3a86e9d2ba89466f7f9ef51c29eb5879bcb8a98e.zip
22w46a
Diffstat (limited to 'src/main/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java')
-rw-r--r--src/main/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java b/src/main/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java
index 240cfb2..a4d6304 100644
--- a/src/main/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java
+++ b/src/main/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java
@@ -1,6 +1,7 @@
package dev.isxander.yacl.gui;
import net.minecraft.client.MinecraftClient;
+import net.minecraft.client.gui.screen.Tooltip;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
@@ -8,18 +9,19 @@ import net.minecraft.util.math.MathHelper;
public class LowProfileButtonWidget extends ButtonWidget {
public LowProfileButtonWidget(int x, int y, int width, int height, Text message, PressAction onPress) {
- super(x, y, width, height, message, onPress);
+ super(x, y, width, height, message, onPress, ButtonWidget.DEFAULT_NARRATION_SUPPLIER);
}
- public LowProfileButtonWidget(int x, int y, int width, int height, Text message, PressAction onPress, TooltipSupplier tooltipSupplier) {
- super(x, y, width, height, message, onPress, tooltipSupplier);
+ public LowProfileButtonWidget(int x, int y, int width, int height, Text message, PressAction onPress, Tooltip tooltip) {
+ this(x, y, width, height, message, onPress);
+ setTooltip(tooltip);
}
@Override
public void renderButton(MatrixStack matrices, int mouseX, int mouseY, float delta) {
if (!isHovered()) {
int j = this.active ? 0xFFFFFF : 0xA0A0A0;
- drawCenteredText(matrices, MinecraftClient.getInstance().textRenderer, this.getMessage(), this.x + this.width / 2, this.y + (this.height - 8) / 2, j | MathHelper.ceil(this.alpha * 255.0F) << 24);
+ drawCenteredText(matrices, MinecraftClient.getInstance().textRenderer, this.getMessage(), this.getX() + this.width / 2, this.getY() + (this.height - 8) / 2, j | MathHelper.ceil(this.alpha * 255.0F) << 24);
} else {
super.renderButton(matrices, mouseX, mouseY, delta);
}