Skip to content

Commit 52c0ead

Browse files
IMS212douira
authored andcommitted
Fix config api
1 parent cab74fa commit 52c0ead

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

common/src/main/java/net/caffeinemc/mods/sodium/client/gui/SodiumConfigBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ private OptionPageBuilder buildQualityPage(ConfigBuilder builder) {
492492
Minecraft.getInstance().levelRenderer.getCloudRenderer().markForRebuild();
493493
}, () -> this.vanillaOpts.cloudRange().get())
494494
.setImpact(OptionImpact.LOW)
495+
.setValueFormatter(ControlValueFormatterImpls.number())
495496
.setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD)
496497
)
497498
.addOption(

common/src/main/java/net/caffeinemc/mods/sodium/client/gui/widgets/DonationButtonWidget.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import net.caffeinemc.mods.sodium.client.gui.VideoSettingsScreen;
77
import net.caffeinemc.mods.sodium.client.util.Dim2i;
88
import net.minecraft.client.gui.GuiGraphics;
9-
import net.minecraft.client.renderer.RenderType;
9+
import net.minecraft.client.renderer.RenderPipelines;
1010
import net.minecraft.network.chat.Component;
1111
import net.minecraft.resources.ResourceLocation;
1212

@@ -123,7 +123,7 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
123123
}
124124

125125
var halfSpriteSize = this.spriteSize / 2;
126-
graphics.blit(RenderType::guiTextured, this.sprite, this.getCenterX() - halfSpriteSize, this.getCenterY() - halfSpriteSize, 0, 0, this.spriteSize, this.spriteSize, this.spriteSize, this.spriteSize, this.getTextColor());
126+
graphics.blit(RenderPipelines.GUI_TEXTURED, this.sprite, this.getCenterX() - halfSpriteSize, this.getCenterY() - halfSpriteSize, 0, 0, this.spriteSize, this.spriteSize, this.spriteSize, this.spriteSize, this.getTextColor());
127127
}
128128
}
129129
}

common/src/main/java/net/caffeinemc/mods/sodium/client/gui/widgets/ScrollableTooltip.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import net.minecraft.client.Minecraft;
1111
import net.minecraft.client.gui.Font;
1212
import net.minecraft.client.gui.GuiGraphics;
13-
import net.minecraft.client.renderer.RenderType;
13+
import net.minecraft.client.renderer.RenderPipelines;
1414
import net.minecraft.network.chat.Component;
1515
import net.minecraft.resources.ResourceLocation;
1616
import net.minecraft.util.FormattedCharSequence;
@@ -145,12 +145,11 @@ public void render(@NotNull GuiGraphics graphics) {
145145
int arrowX = this.visibleDim.x() - ARROW_WIDTH;
146146
int arrowY = this.hoveredElement.getCenterY() - (ARROW_HEIGHT / 2);
147147

148-
graphics.pose().pushPose();
149-
graphics.pose().translate(0.0F, 0.0F, 400.0F);
148+
graphics.nextStratum();
150149

151150
// parameters are: render type, sprite, x, y, u offset, v offset, render width, render height, u size, v size, color
152-
graphics.blit(RenderType::guiTextured, ARROW_TEXTURE, arrowX, arrowY, ARROW_WIDTH, 0, ARROW_WIDTH, ARROW_HEIGHT, SPRITE_WIDTH, ARROW_HEIGHT, Colors.BACKGROUND_LIGHT);
153-
graphics.blit(RenderType::guiTextured, ARROW_TEXTURE, arrowX, arrowY, 0, 0, ARROW_WIDTH, ARROW_HEIGHT, SPRITE_WIDTH, ARROW_HEIGHT, Colors.BACKGROUND_DEFAULT);
151+
graphics.blit(RenderPipelines.GUI_TEXTURED, ARROW_TEXTURE, arrowX, arrowY, ARROW_WIDTH, 0, ARROW_WIDTH, ARROW_HEIGHT, SPRITE_WIDTH, ARROW_HEIGHT, Colors.BACKGROUND_LIGHT);
152+
graphics.blit(RenderPipelines.GUI_TEXTURED, ARROW_TEXTURE, arrowX, arrowY, 0, 0, ARROW_WIDTH, ARROW_HEIGHT, SPRITE_WIDTH, ARROW_HEIGHT, Colors.BACKGROUND_DEFAULT);
154153

155154
int lineHeight = this.getLineHeight();
156155

@@ -161,14 +160,13 @@ public void render(@NotNull GuiGraphics graphics) {
161160

162161
graphics.enableScissor(this.visibleDim.x(), this.visibleDim.y(), this.visibleDim.getLimitX(), this.visibleDim.getLimitY());
163162
graphics.fill(this.visibleDim.x(), this.visibleDim.y(), this.visibleDim.getLimitX(), this.visibleDim.getLimitY(), Colors.BACKGROUND_LIGHT);
164-
graphics.pose().translate(0.0F, 0.0F, 400.0F);
163+
graphics.nextStratum();
165164
for (int i = 0; i < this.content.size(); i++) {
166165
graphics.drawString(this.font, this.content.get(i),
167166
this.visibleDim.x() + TEXT_HORIZONTAL_PADDING, this.visibleDim.y() + TEXT_VERTICAL_PADDING + (i * lineHeight) - scrollAmount,
168167
Colors.FOREGROUND);
169168
}
170169
graphics.disableScissor();
171-
graphics.pose().popPose();
172170
}
173171

174172
public boolean mouseScrolled(double d, double e, double amount) {

0 commit comments

Comments
 (0)