aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/gui
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2021-06-17 00:31:22 -0400
committerbowser0000 <bowser0000@gmail.com>2021-06-17 00:31:22 -0400
commit5c7c3d0f5ca04df48c2b8f054a662300e9f0d14b (patch)
treeb73fb22495038d2e1b4f16d99f56149e131beefc /src/main/java/me/Danker/gui
parent9e5039be5c1f874a6622301daca2b6780dec02ca (diff)
downloadSkyblockMod-5c7c3d0f5ca04df48c2b8f054a662300e9f0d14b.tar.gz
SkyblockMod-5c7c3d0f5ca04df48c2b8f054a662300e9f0d14b.tar.bz2
SkyblockMod-5c7c3d0f5ca04df48c2b8f054a662300e9f0d14b.zip
Fix edit location buttons not having correct hitbox
Diffstat (limited to 'src/main/java/me/Danker/gui')
-rw-r--r--src/main/java/me/Danker/gui/buttons/LocationButton.java15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/main/java/me/Danker/gui/buttons/LocationButton.java b/src/main/java/me/Danker/gui/buttons/LocationButton.java
index f328c58..8da1ab9 100644
--- a/src/main/java/me/Danker/gui/buttons/LocationButton.java
+++ b/src/main/java/me/Danker/gui/buttons/LocationButton.java
@@ -40,24 +40,19 @@ public class LocationButton extends GuiButton {
}
this.longestText = longestText;
+ int offset = text2Offset == null ? 0 : text2Offset;
this.height = (int) ((splitText.length * 9 + 3) * scale);
- this.width = (int) ((this.longestText + 3) * scale);
+ this.width = (int) ((this.longestText + offset + 3) * scale);
}
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
- if (text2 == null) {
- drawRect(x - 2, y - 2, x + width, y + height, 0x40D3D3D3);
- } else {
- drawRect(x - 2, y - 2, (int) (x + (longestText + text2Offset + 3) * scale), y + height, 0x40D3D3D3);
- new TextRenderer(mc, text2, (int) (x + (text2Offset * scale)), y, scale);
- }
+ drawRect(x - 2, y - 2, x + width, y + height, 0x40D3D3D3);
+ if (text2 != null) new TextRenderer(mc, text2, (int) (x + (text2Offset * scale)), y, scale);
new TextRenderer(mc, text, x, y, scale);
}
@Override
- public void playPressSound(SoundHandler soundHandler) {
-
- }
+ public void playPressSound(SoundHandler soundHandler) {}
}