From f3efa570a4224fec085b36dbac4c461deb9e874d Mon Sep 17 00:00:00 2001 From: Mrbysco Date: Mon, 4 Mar 2024 21:54:00 +0100 Subject: [PATCH] Update TexturedButton.java --- .../mod/inventory/gui/TexturedButton.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java index e3dde93ba..25562a478 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java @@ -45,20 +45,17 @@ public class TexturedButton extends Button { } @Override - public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { - if (this.visible) { - RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); - this.isHovered = mouseX >= this.getX() && mouseY >= this.getY() && mouseX < this.getX() + this.width && mouseY < this.getY() + this.height; - int k = this.isHovered + public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { + RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); + int k = this.isHovered ? 1 : 0; - GlStateManager._enableBlend(); - GlStateManager._blendFuncSeparate(770, 771, 1, 0); - GlStateManager._blendFunc(770, 771); - guiGraphics.blit(this.resLoc, this.getX(), this.getY(), this.texturePosX, this.texturePosY - this.height + k * this.height, this.width, this.height); - // this.mouseDragged(minecraft, x, y); - } + GlStateManager._enableBlend(); + GlStateManager._blendFuncSeparate(770, 771, 1, 0); + GlStateManager._blendFunc(770, 771); + guiGraphics.blit(this.resLoc, this.getX(), this.getY(), this.texturePosX, this.texturePosY - this.height + k * this.height, this.width, this.height); + // this.mouseDragged(minecraft, x, y); } public void drawHover(GuiGraphics guiGraphics, int x, int y) {