aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl3/gui/LowProfileButtonWidget.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/dev/isxander/yacl3/gui/LowProfileButtonWidget.java')
-rw-r--r--src/main/java/dev/isxander/yacl3/gui/LowProfileButtonWidget.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/dev/isxander/yacl3/gui/LowProfileButtonWidget.java b/src/main/java/dev/isxander/yacl3/gui/LowProfileButtonWidget.java
new file mode 100644
index 0000000..3f5822f
--- /dev/null
+++ b/src/main/java/dev/isxander/yacl3/gui/LowProfileButtonWidget.java
@@ -0,0 +1,28 @@
+package dev.isxander.yacl3.gui;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiGraphics;
+import net.minecraft.client.gui.components.Button;
+import net.minecraft.client.gui.components.Tooltip;
+import net.minecraft.network.chat.Component;
+
+public class LowProfileButtonWidget extends Button {
+ public LowProfileButtonWidget(int x, int y, int width, int height, Component message, OnPress onPress) {
+ super(x, y, width, height, message, onPress, DEFAULT_NARRATION);
+ }
+
+ public LowProfileButtonWidget(int x, int y, int width, int height, Component message, OnPress onPress, Tooltip tooltip) {
+ this(x, y, width, height, message, onPress);
+ setTooltip(tooltip);
+ }
+
+ @Override
+ public void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float deltaTicks) {
+ if (!isHoveredOrFocused() || !active) {
+ int j = this.active ? 0xFFFFFF : 0xA0A0A0;
+ this.renderString(graphics, Minecraft.getInstance().font, j);
+ } else {
+ super.renderWidget(graphics, mouseX, mouseY, deltaTicks);
+ }
+ }
+}