mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 16:54:22 +00:00
Fire RenderGameOverlayEvent for vignette (#4360)
This commit is contained in:
1 parent
fe3ba2b40e
commit
cb8cace92d
2 files changed
+18
-2
No files matched your search
@@ -71,6 +71,7 @@ public class GuiIngameForge extends GuiIngame
|
||||
//Flags to toggle the rendering of certain aspects of the HUD, valid conditions
|
||||
//must be met for them to render normally. If those conditions are met, but this flag
|
||||
//is false, they will not be rendered.
|
||||
public static boolean renderVignette = true;
|
||||
public static boolean renderHelmet = true;
|
||||
public static boolean renderPortal = true;
|
||||
public static boolean renderHotbar = true;
|
||||
@@ -120,7 +121,7 @@ public class GuiIngameForge extends GuiIngame
|
||||
mc.entityRenderer.setupOverlayRendering();
|
||||
GlStateManager.enableBlend();
|
||||
|
||||
if (Minecraft.isFancyGraphicsEnabled())
|
||||
if (renderVignette && Minecraft.isFancyGraphicsEnabled())
|
||||
{
|
||||
renderVignette(mc.player.getBrightness(), res);
|
||||
}
|
||||
@@ -247,6 +248,20 @@ public class GuiIngameForge extends GuiIngame
|
||||
post(BOSSHEALTH);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderVignette(float lightLevel, ScaledResolution scaledRes)
|
||||
{
|
||||
if (pre(VIGNETTE))
|
||||
{
|
||||
// Need to put this here, since Vanilla assumes this state after the vignette was rendered.
|
||||
GlStateManager.enableDepth();
|
||||
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||
return;
|
||||
}
|
||||
super.renderVignette(lightLevel, scaledRes);
|
||||
post(VIGNETTE);
|
||||
}
|
||||
|
||||
private void renderHelmet(ScaledResolution res, float partialTicks)
|
||||
{
|
||||
if (pre(HELMET)) return;
|
||||
|
||||
@@ -66,7 +66,8 @@ public class RenderGameOverlayEvent extends Event
|
||||
DEBUG,
|
||||
POTION_ICONS,
|
||||
SUBTITLES,
|
||||
FPS_GRAPH
|
||||
FPS_GRAPH,
|
||||
VIGNETTE
|
||||
}
|
||||
|
||||
private final float partialTicks;
|
||||
|
||||
Reference in new issue
Block a user