From 041381830f478df21d0696014053cbf5d66528b3 Mon Sep 17 00:00:00 2001 From: Mrbysco Date: Tue, 5 Mar 2024 16:05:29 +0100 Subject: [PATCH] Fix Buttons rendering on mouse instead of at their position --- .../actuallyadditions/mod/inventory/gui/Buttons.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java index 0dffd28c8..124d0e9a2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java @@ -35,13 +35,11 @@ public class Buttons { public void renderWidget(@Nonnull GuiGraphics guiGraphics, int mouseX, int mouseY, float f) { if (this.visible) { RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); - RenderSystem.setShaderTexture(0, this.resLoc); - this.isHovered = mouseX >= this.getX() && mouseY >= this.getY() && mouseX < this.getX() + this.width && mouseY < this.getY() + this.height; int k = !this.active ? 0 : (this.isHoveredOrFocused() ? 2 : 1); GlStateManager._enableBlend(); GlStateManager.glBlendFuncSeparate(770, 771, 1, 0); GlStateManager._blendFunc(770, 771); - guiGraphics.blit(this.resLoc, mouseX, mouseY, this.smaller + guiGraphics.blit(this.resLoc, this.getX(), this.getY(), this.smaller ? 200 : 176, k * this.height, this.width, this.height); //this.mouseDragged(mc, x, y); // The heck was this doing here? @@ -74,8 +72,6 @@ public class Buttons { public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float f) { if (this.visible) { RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); - RenderSystem.setShaderTexture(0, this.resLoc); - this.isHovered = mouseX >= this.getX() && mouseY >= this.getY() && mouseX < this.getX() + this.width && mouseY < this.getY() + this.height; int k = !this.active ? 0 : (this.isHoveredOrFocused() ? 2 : 1); GlStateManager._enableBlend(); GlStateManager.glBlendFuncSeparate(770, 771, 1, 0);