Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Core/Layer/Options/Sections/ListedConfigSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ private void SetDisableStates()
m_config.Render.LightMode.OptionDisabled = paletteMode;
m_config.Render.EmulateInvulnerabilityColorMap.OptionDisabled = paletteMode;
m_config.Render.DownScaleVanillaRenderSampleBuffer.OptionDisabled = m_config.Render.VanillaRender.Value == false;

m_config.Render.AlternativeInvulnerabilityColor.OptionDisabled = m_config.Render.AlternativeInvulnerabilityOverlay.Value == false;

m_config.Mouse.ForwardBackwardSpeed.OptionDisabled = m_config.Mouse.Look.Value == true;

Expand Down
7 changes: 7 additions & 0 deletions Core/Layer/Worlds/WorldLayer.Render.Hud.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,13 @@ private void DrawHudEffects(IHudRenderContext hud)
hud.Clear(box, powerup.DrawColor.Value, alpha);
}

var invuln = Player.Inventory.PowerupEffectColorMap;
if (m_config.Render.AlternativeInvulnerabilityOverlay && invuln is { PowerupType: PowerupType.Invulnerable, DrawPowerupEffect: true })
{
var customColor = m_config.Render.AlternativeInvulnerabilityColor.Value;
hud.Clear(box, new Color((byte)customColor.X, (byte)customColor.Y, (byte)customColor.Z), 0.15f);
}

if (Player.BonusCount > 0)
{
const float PickupScaleAmount = 3f;
Expand Down
9 changes: 9 additions & 0 deletions Core/Util/Configs/Components/ConfigRender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Helion.Util.Configs.Options;
using Helion.Util.Configs.Values;
using System.ComponentModel;
using Helion.Geometry.Vectors;
using static Helion.Util.Configs.Values.ConfigFilters;

namespace Helion.Util.Configs.Components;
Expand Down Expand Up @@ -166,6 +167,14 @@ public class ConfigRender: ConfigElement<ConfigRender>
[ConfigInfo("Emulates custom invulnerability palettes in true color mode. May not work well with all WADs. Application restart required.", restartRequired: true)]
[OptionMenu(OptionSectionType.Render, "Emulate Invulnerability Colormap")]
public readonly ConfigValue<bool> EmulateInvulnerabilityColorMap = new(false);

[ConfigInfo("Uses a custom color overlay for Invulnerability instead of the vanilla inverse/white strobe.")]
[OptionMenu(OptionSectionType.Render, "Alternative Invulnerability Overlay")]
public readonly ConfigValue<bool> AlternativeInvulnerabilityOverlay = new(false);

[ConfigInfo("The color used for the alternative invulnerability overlay.")]
[OptionMenu(OptionSectionType.Render, "Alternative Invulnerability Color")]
public readonly ConfigValue<Vec3I> AlternativeInvulnerabilityColor = new((0, 255, 0), ClampColor);

[ConfigInfo("Line contrast mode.", mapRestartRequired: true)]
[OptionMenu(OptionSectionType.Render, "Line contrast mode")]
Expand Down
7 changes: 6 additions & 1 deletion Core/World/Entities/Players/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ public virtual bool DrawFullBright()

foreach (PowerupType powerupType in PowerupsWithBrightness)
{
if (powerupType == PowerupType.Invulnerable && WorldStatic.World.Config.Render.AlternativeInvulnerabilityOverlay)
continue;

IPowerup? powerup = Inventory.GetPowerup(powerupType);
if (powerup != null)
return powerup.DrawPowerupEffect;
Expand All @@ -144,7 +147,9 @@ public virtual bool DrawFullBright()

public bool HasLightAmp() => Inventory.GetPowerup(PowerupType.LightAmp) != null;

public bool DrawInvulnerableColorMap() => Inventory.PowerupEffectColorMap != null && Inventory.PowerupEffectColorMap.DrawPowerupEffect;
public bool DrawInvulnerableColorMap() =>
!WorldStatic.World.Config.Render.AlternativeInvulnerabilityOverlay &&
Inventory.PowerupEffectColorMap is { DrawPowerupEffect: true };
public int GetExtraLightRender() => WorldStatic.World.Config.Render.ExtraLight + (ExtraLight * Constants.ExtraLightFactor);

public override double ViewZ => m_viewZ;
Expand Down
Loading