diff options
author | Aaron <51387595+AzureAaron@users.noreply.github.com> | 2023-03-16 20:25:01 -0400 |
---|---|---|
committer | Aaron <51387595+AzureAaron@users.noreply.github.com> | 2023-03-16 20:25:01 -0400 |
commit | 48f747d47a97c71ccdb9cc4733a38e7debdd49cc (patch) | |
tree | 60d63b0db4f81126f5397c1a7e13885a5f3492fd /src/main/java/me/xmrvizzy/skyblocker | |
parent | e79b25bdb4ae369cc064ab692b5a67b046d2e18a (diff) | |
download | Skyblocker-48f747d47a97c71ccdb9cc4733a38e7debdd49cc.tar.gz Skyblocker-48f747d47a97c71ccdb9cc4733a38e7debdd49cc.tar.bz2 Skyblocker-48f747d47a97c71ccdb9cc4733a38e7debdd49cc.zip |
Fix QuickNav Button Positions
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker')
-rw-r--r-- | src/main/java/me/xmrvizzy/skyblocker/skyblock/quicknav/QuickNavButton.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/quicknav/QuickNavButton.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/quicknav/QuickNavButton.java index d976b86b..de609c52 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/quicknav/QuickNavButton.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/quicknav/QuickNavButton.java @@ -28,7 +28,7 @@ public class QuickNavButton extends ClickableWidget { private final ItemStack icon; public QuickNavButton(int index, boolean toggled, String command, ItemStack icon) { - super(0, 0, 28, 32, Text.empty()); + super(0, 0, 26, 32, Text.empty()); this.index = index; this.toggled = toggled; this.command = command; @@ -45,10 +45,10 @@ public class QuickNavButton extends ClickableWidget { int h = ((HandledScreenAccessor)handledScreen).getBackgroundHeight(); if (h > 166) --h; // why is this even a thing // this.x = x + this.index % 6 * 28 + 4; - this.setX(x + this.index % 6 * 28 + 4); + this.setX(x + this.index % 6 * 26 + 4); // this.y = this.index < 6 ? y - 28 : y + h - 4; - this.setY(this.index < 6 ? y - 28 : y + h - 4); - this.u = 28; + this.setY(this.index < 6 ? y - 26 : y + h - 4); + this.u = 26; this.v = (index < 6 ? 0 : 64) + (toggled ? 32 : 0); } } @@ -68,6 +68,9 @@ public class QuickNavButton extends ClickableWidget { this.updateCoordinates(); RenderSystem.setShaderTexture(0, BUTTON_TEXTURE); RenderSystem.disableDepthTest(); + //Move buttons 1 pixel up + matrices.push(); + matrices.translate(0f, -1f, 0f); // render button background if (!this.toggled) { if (this.index >= 6) @@ -78,6 +81,7 @@ public class QuickNavButton extends ClickableWidget { this.drawTexture(matrices, this.getX(), this.getY(), this.u, this.v, this.width, this.height - 4); // } else this.drawTexture(matrices, this.x, this.y, this.u, this.v, this.width, this.height); } else this.drawTexture(matrices, this.getX(), this.getY(), this.u, this.v, this.width, this.height); + matrices.pop(); // render button icon if (!this.toggled) { if (this.index >= 6) |