|
8 | 8 | import java.util.Calendar;
|
9 | 9 | import java.util.List;
|
10 | 10 |
|
| 11 | +import net.minecraft.util.Mth; |
11 | 12 | import org.jetbrains.annotations.NotNull;
|
12 | 13 |
|
13 | 14 | import com.mojang.blaze3d.systems.RenderSystem;
|
@@ -110,14 +111,30 @@ public QButton(int x, int y) {
|
110 | 111 | showBubble = !getQuarkMarkerFile().exists();
|
111 | 112 | }
|
112 | 113 |
|
113 |
| - @Override |
114 | 114 | public int getFGColor() {
|
115 | 115 | return gay ? Color.HSBtoRGB((ClientTicker.total / 200F), 1F, 1F) : 0x48DDBC;
|
116 | 116 | }
|
117 | 117 |
|
118 | 118 | @Override
|
119 | 119 | public void renderButton(@NotNull PoseStack mstack, int mouseX, int mouseY, float partialTicks) {
|
120 |
| - super.renderButton(mstack, mouseX, mouseY, partialTicks); |
| 120 | + // "Oh Siuol you silly child, super.renderButton() exists!" I know, but a certain Forge Loader adds a method that doesnt exist on Quilt. |
| 121 | + Minecraft minecraft = Minecraft.getInstance(); |
| 122 | + Font font = minecraft.font; |
| 123 | + RenderSystem.setShader(GameRenderer::getPositionTexShader); |
| 124 | + RenderSystem.setShaderTexture(0, WIDGETS_LOCATION); |
| 125 | + RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, this.alpha); |
| 126 | + int k = this.getYImage(this.isHoveredOrFocused()); |
| 127 | + RenderSystem.enableBlend(); |
| 128 | + RenderSystem.defaultBlendFunc(); |
| 129 | + RenderSystem.enableDepthTest(); |
| 130 | + this.blit(mstack, this.x, this.y, 0, 46 + k * 20, this.width / 2, this.height); |
| 131 | + this.blit(mstack, this.x + this.width / 2, this.y, 200 - this.width / 2, 46 + k * 20, this.width / 2, this.height); |
| 132 | + this.renderBg(mstack, minecraft, mouseX, mouseY); |
| 133 | + int l = getFGColor(); |
| 134 | + drawCenteredString(mstack, font, this.getMessage(), this.x + this.width / 2, this.y + (this.height - 8) / 2, l | Mth.ceil(this.alpha * 255.0F) << 24); |
| 135 | + if (this.isHoveredOrFocused()) { |
| 136 | + this.renderToolTip(mstack, mouseX, mouseY); |
| 137 | + } |
121 | 138 |
|
122 | 139 | int iconIndex = Math.min(4, ContributorRewardHandler.localPatronTier);
|
123 | 140 | if(celebrating != null) {
|
@@ -155,7 +172,6 @@ public void renderButton(@NotNull PoseStack mstack, int mouseX, int mouseY, floa
|
155 | 172 | }
|
156 | 173 |
|
157 | 174 | if(showBubble && GeneralConfig.enableOnboarding) {
|
158 |
| - Font font = Minecraft.getInstance().font; |
159 | 175 | int cy = y - 2;
|
160 | 176 | if(ClientTicker.total % 20 > 10)
|
161 | 177 | cy++;
|
|
0 commit comments