[vintage] Increase blend radius to 14 and fix compile of 1.12.2 #24
No files matched your search
@@ -62,12 +62,7 @@ public class SodiumGameOptionPages {
|
|||||||
.setTooltip(ComponentUtil.translatable("sodium.options.gui_scale.tooltip"))
|
.setTooltip(ComponentUtil.translatable("sodium.options.gui_scale.tooltip"))
|
||||||
.setControl(option -> new SliderControl(option, 0, MuiGuiScaleHook.getMaxGuiScale(), 1, ControlValueFormatter.guiScale()))
|
.setControl(option -> new SliderControl(option, 0, MuiGuiScaleHook.getMaxGuiScale(), 1, ControlValueFormatter.guiScale()))
|
||||||
.setBinding((opts, value) -> {
|
.setBinding((opts, value) -> {
|
||||||
// Convert Auto to the highest possible scale, because on 1.12.2 Auto breaks ScrollableFrame
|
|
||||||
if (value == 0) {
|
|
||||||
opts.guiScale = MuiGuiScaleHook.getMaxGuiScale();
|
|
||||||
} else {
|
|
||||||
opts.guiScale = value;
|
opts.guiScale = value;
|
||||||
}
|
|
||||||
|
|
||||||
Minecraft mc = Minecraft.getMinecraft();
|
Minecraft mc = Minecraft.getMinecraft();
|
||||||
mc.resize(mc.displayWidth, mc.displayHeight);
|
mc.resize(mc.displayWidth, mc.displayHeight);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.taumc.celeritas.impl.gui.compat;
|
|||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
import net.minecraft.client.gui.Gui;
|
import net.minecraft.client.gui.Gui;
|
||||||
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import org.lwjgl.opengl.GL20C;
|
import org.lwjgl.opengl.GL20C;
|
||||||
@@ -27,9 +28,11 @@ public class GuiGraphics {
|
|||||||
public void enableScissor(int x, int y, int x2, int y2) {
|
public void enableScissor(int x, int y, int x2, int y2) {
|
||||||
int width = x2 - x + 1;
|
int width = x2 - x + 1;
|
||||||
int height = y2 - y + 1;
|
int height = y2 - y + 1;
|
||||||
int scale = Minecraft.getMinecraft().gameSettings.guiScale;
|
var mc = Minecraft.getMinecraft();
|
||||||
|
ScaledResolution scaledresolution = new ScaledResolution(mc);
|
||||||
|
int scale = scaledresolution.getScaleFactor();
|
||||||
GL20C.glEnable(3089);
|
GL20C.glEnable(3089);
|
||||||
GL20C.glScissor(x * scale, Minecraft.getMinecraft().displayHeight - (y + height) * scale, width * scale, height * scale);
|
GL20C.glScissor(x * scale, mc.displayHeight - (y + height) * scale, width * scale, height * scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableScissor() {
|
public void disableScissor() {
|
||||||
|
|||||||
Reference in new issue
Block a user