Skip to content

Commit ccdc60e

Browse files
Fix button fade in
1 parent ef13aa3 commit ccdc60e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/main/java/gg/essential/partnermod/AdButton.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
//$$ import net.minecraft.client.gui.DrawContext;
4141
//#endif
4242

43+
//#if MC>=12104
44+
//$$ import net.minecraft.util.math.ColorHelper;
45+
//#endif
46+
4347
public class AdButton extends GuiButton {
4448

4549
public static ResourceLocation TEXTURE_MAIN_MENU = Resources.load("button_mainmenu.png");
@@ -89,7 +93,16 @@ public AdButton(int x, int y, ResourceLocation texture, Consumer<GuiButton> onPr
8993
//$$ int x = 0;
9094
//$$ if (this.isHovered()) x += this.width;
9195
//$$
92-
//#if MC>=12102
96+
//#if MC>=12104
97+
//#elseif MC>=11700
98+
//$$ RenderSystem.setShaderColor(1f, 1f, 1f, this.alpha);
99+
//#else
100+
//$$ RenderSystem.color4f(1f, 1f, 1f, this.alpha);
101+
//#endif
102+
//$$
103+
//#if MC>=12105
104+
//$$ context.drawTexture(RenderLayer::getGuiTextured, texture, this.getX(), this.getY(), x, 0, width, height, width * 2, height, ColorHelper.getWhite(this.alpha));
105+
//#elseif MC>=12102
93106
//$$ context.drawTexture(RenderLayer::getGuiTextured, texture, this.getX(), this.getY(), x, 0, width, height, width * 2, height);
94107
//#elseif MC>=12000
95108
//$$ context.drawTexture(texture, this.getX(), this.getY(), 0, x, 0, width, height, width * 2, height);

0 commit comments

Comments
 (0)