Add toggle for displaying invisible SRB2 FOFs

This commit is contained in:
spherallic 2022-12-06 00:20:42 +01:00
parent ef8473bd99
commit c063986e00
6 changed files with 33 additions and 1 deletions

View File

@ -985,6 +985,7 @@ linedeftypes
flags128text = "[7] Only block non-players";
3dfloor = true;
3dfloorflags = "47";
invisiblefof = true;
}
140
@ -1222,6 +1223,7 @@ linedeftypes
prefix = "(223)";
3dfloor = true;
3dfloorflags = "41";
invisiblefof = true;
}
}
@ -1519,6 +1521,7 @@ linedeftypes
prefix = "(200)";
3dfloor = true;
3dfloorflags = "20201";
invisiblefof = true;
}
201
@ -1527,6 +1530,7 @@ linedeftypes
prefix = "(201)";
3dfloor = true;
3dfloorflags = "201";
invisiblefof = true;
}
202
@ -1535,6 +1539,7 @@ linedeftypes
prefix = "(202)";
3dfloor = true;
3dfloorflags = "3EF19";
invisiblefof = true;
}
250

View File

@ -50,6 +50,7 @@ namespace CodeImp.DoomBuilder.Config
private readonly int slopeargs;
private readonly int copyslopeargs;
private readonly bool threedfloor;
private readonly bool invisiblefof;
private readonly bool threedfloorcustom;
private readonly int threedfloorflags;
private readonly IDictionary<string,int> threedfloorflagsadditions;
@ -75,6 +76,7 @@ namespace CodeImp.DoomBuilder.Config
public int SlopeArgs { get { return slopeargs; } }
public int CopySlopeArgs { get { return copyslopeargs; } }
public bool ThreeDFloor { get { return threedfloor; } }
public bool InvisibleFOF { get { return invisiblefof; } }
public bool ThreeDFloorCustom { get { return threedfloorcustom; } }
public int ThreeDFloorFlags { get { return threedfloorflags; } }
#endregion
@ -106,6 +108,7 @@ namespace CodeImp.DoomBuilder.Config
this.slopeargs = cfg.ReadSetting(actionsetting + ".slopeargs", 0);
this.copyslopeargs = cfg.ReadSetting(actionsetting + ".copyslopeargs", 0);
this.threedfloor = cfg.ReadSetting(actionsetting + ".3dfloor", false);
this.invisiblefof = cfg.ReadSetting(actionsetting + ".invisiblefof", false);
this.threedfloorcustom = cfg.ReadSetting(actionsetting + ".3dfloorcustom", false);
try { this.threedfloorflags = Convert.ToInt32(cfg.ReadSetting(actionsetting + ".3dfloorflags", "0"), 16); }
catch (FormatException) { this.threedfloorflags = 0; }
@ -142,6 +145,7 @@ namespace CodeImp.DoomBuilder.Config
this.slopeargs = 0;
this.copyslopeargs = 0;
this.threedfloor = false;
this.invisiblefof = false;
this.threedfloorcustom = false;
this.threedfloorflags = 0;
this.threedfloorflagsadditions = new Dictionary<string, int>();

View File

@ -122,6 +122,7 @@ namespace CodeImp.DoomBuilder.Config
private string lastUsedMapFolder;
private bool gzMarkExtraFloors;
private bool gzdoomrenderingeffects = true; //mxd
private bool srb2renderingeffects = true; //sphere
private bool showcolormaps = true;
private bool drawCrosshair;
private bool drawFullCrosshair;
@ -233,6 +234,7 @@ namespace CodeImp.DoomBuilder.Config
public string LastUsedMapFolder { get { return lastUsedMapFolder; } internal set { lastUsedMapFolder = value; } }
public bool GZMarkExtraFloors { get { return gzMarkExtraFloors; } internal set { gzMarkExtraFloors = value; } }
public bool GZDoomRenderingEffects { get { return gzdoomrenderingeffects; } set { gzdoomrenderingeffects = value; } } //mxd
public bool SRB2RenderingEffects { get { return srb2renderingeffects; } set { srb2renderingeffects = value; } } //sphere
public bool ShowColormaps { get { return showcolormaps; } set { showcolormaps = value; } } //mxd
public bool DrawCrosshair { get { return drawCrosshair; } internal set { drawCrosshair = value; } }
public bool DrawFullCrosshair { get { return drawFullCrosshair; } internal set { drawFullCrosshair = value; } }

View File

@ -92,6 +92,7 @@ namespace CodeImp.DoomBuilder.Map
public int Action { get { return action; } set { BeforePropsChange(); action = value; UpdateColorPreset(); } }
public int Activate { get { return activate; } set { BeforePropsChange(); activate = value; UpdateColorPreset(); } }
public bool Is3DFloor { get { return (!General.Map.SRB2 && Action == 160) || General.Map.Config.GetLinedefActionInfo(Action).ThreeDFloor; } }
public bool IsInvisibleFOF { get { return General.Map.SRB2 && General.Map.Config.GetLinedefActionInfo(Action).InvisibleFOF; } }
public bool IsCustom3DFloor { get { return General.Map.Config.GetLinedefActionInfo(Action).ThreeDFloorCustom; } }
public bool IsRegularSlope { get { return (!General.Map.SRB2 && Action == 181) || General.Map.Config.GetLinedefActionInfo(Action).IsRegularSlope; } }
public bool IsCopySlope { get { return (!General.Map.SRB2 && Action == 118) || General.Map.Config.GetLinedefActionInfo(Action).IsCopySlope; } }

View File

@ -1597,6 +1597,16 @@ togglegzdoomgeometryeffects
default = 9; //Tab
}
togglesrb2geometryeffects
{
title = "Toggle SRB2 Invisible FOFs";
category = "visual";
description = "Toggles rendering of SRB2's invisible FOF types (light blocks, trigger zones etc.) in Visual mode.";
allowkeys = true;
allowmouse = true;
allowscroll = false;
}
togglecolormaps
{
title = "Toggle Colormaps";

View File

@ -1184,7 +1184,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// MascaraSnake: 3D floor handling
// ========== Sector 3D floor (see http://zdoom.org/wiki/Sector_Set3dFloor) ==========
if (l.Is3DFloor)
if (l.Is3DFloor && (General.Settings.SRB2RenderingEffects || !l.IsInvisibleFOF))
{
if (l.Front != null)
{
@ -3678,6 +3678,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Interface.DisplayStatus(StatusType.Info, "(G)ZDoom geometry effects are " + (General.Settings.GZDoomRenderingEffects ? "ENABLED" : "DISABLED"));
}
//mxd
[BeginAction("togglesrb2geometryeffects")]
public void ToggleSRB2RenderingEffects()
{
General.Settings.SRB2RenderingEffects = !General.Settings.SRB2RenderingEffects;
RebuildElementData();
UpdateChangedObjects();
General.Interface.DisplayStatus(StatusType.Info, "SRB2 invisible FOFs are " + (General.Settings.SRB2RenderingEffects ? "ENABLED" : "DISABLED"));
}
//mxd
[BeginAction("togglecolormaps")]
public void ToggleColormaps()