Skip to content

Commit

Permalink
Merge pull request #43 from ZZZank/12.x/forge
Browse files Browse the repository at this point in the history
Fix vignette config
  • Loading branch information
Asek3 authored Jul 10, 2024
2 parents 29dc4a8 + fb6a4d3 commit 29c95c4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import net.minecraft.client.Minecraft;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraftforge.client.GuiIngameForge;

import org.lwjgl.opengl.Display;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
package me.jellysquid.mods.sodium.mixin.features.options;

import me.jellysquid.mods.sodium.client.SodiumClientMod;
import net.minecraft.client.gui.GuiIngame;
import net.minecraftforge.client.GuiIngameForge;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(GuiIngame.class)
/**
* note that both {@link net.minecraft.client.gui.GuiIngame} and {@link net.minecraftforge.client.GuiIngameForge}
* implements client GUI rendering, and mixins for GuiIngame can be totally useless since GuiIngame might be
* intentionally ignored and barely invoked
*/
@Mixin(GuiIngameForge.class)
public class MixinInGameHud {
@Redirect(method = "renderGameOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;isFancyGraphicsEnabled()Z"))
private boolean redirectFancyGraphicsVignette() {
private boolean vintagium$redirectVignette() {
//mixin target is `if (renderVignette && Minecraft.isFancyGraphicsEnabled())`
//we assume that `renderVignette` is always true, because vanilla/forge will not change its value, and mods that
//will change it explicitly must have a reason.
return SodiumClientMod.options().quality.enableVignette;
}
}

0 comments on commit 29c95c4

Please sign in to comment.