diff options
author | Aaron <51387595+AzureAaron@users.noreply.github.com> | 2023-03-16 21:08:38 -0400 |
---|---|---|
committer | Aaron <51387595+AzureAaron@users.noreply.github.com> | 2023-03-16 21:08:38 -0400 |
commit | 0e5477d416b836c36df5dd93979e09b5ec389526 (patch) | |
tree | f1b8714a394727e38824008065f2557e278338f0 /src/main/java/me/xmrvizzy/skyblocker/skyblock/quicknav | |
parent | d27e15f8f346e9859edf5d034d258462e5a4871c (diff) | |
download | Skyblocker-0e5477d416b836c36df5dd93979e09b5ec389526.tar.gz Skyblocker-0e5477d416b836c36df5dd93979e09b5ec389526.tar.bz2 Skyblocker-0e5477d416b836c36df5dd93979e09b5ec389526.zip |
Fix incorrect matrix transformations with selected QuickNav buttons
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock/quicknav')
-rw-r--r-- | src/main/java/me/xmrvizzy/skyblocker/skyblock/quicknav/QuickNavButton.java | 16 |
1 files changed, 11 insertions, 5 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 3317a54f..7e82ecef 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/quicknav/QuickNavButton.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/quicknav/QuickNavButton.java @@ -67,11 +67,11 @@ 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) { + //Move buttons 1 pixel up if they aren't selected + matrices.push(); + matrices.translate(0f, -1f, 0f); if (this.index >= 6) // this.drawTexture(matrices, this.x, this.y + 4, this.u, this.v + 4, this.width, this.height - 4); this.drawTexture(matrices, this.getX(), this.getY() + 4, this.u, this.v + 4, this.width, this.height - 4); @@ -79,8 +79,14 @@ public class QuickNavButton extends ClickableWidget { // this.drawTexture(matrices, this.x, this.y, this.u, this.v, this.width, this.height - 4); 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(); + matrices.pop(); + } else { + matrices.push(); + //Move the top buttons 2 pixels up if they're selected + if (this.index <= 6) matrices.translate(0f, -2f, 0f); + 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) |