diff --git a/Build/Configurations/Includes/ZDoom_common.cfg b/Build/Configurations/Includes/ZDoom_common.cfg index 5a392ae7..47b3a2d5 100644 --- a/Build/Configurations/Includes/ZDoom_common.cfg +++ b/Build/Configurations/Includes/ZDoom_common.cfg @@ -340,6 +340,9 @@ mapformat_udmf // WARNING: this should only be enabled for UDMF game configurations! // WARNING: enabling this will make maps incompatible with Doom Builder 2 and can lead to problems in Slade 3! longtexturenames = true; + + // Enables support for individual offsets of upper/middle/lower sidedef textures + localsidedeftextureoffsets = true; // Default nodebuilder configurations defaultsavecompiler = "zdbsp_udmf_normal"; diff --git a/Help/gc_basicsettings.html b/Help/gc_basicsettings.html index 509ef63a..7ceb95b1 100644 --- a/Help/gc_basicsettings.html +++ b/Help/gc_basicsettings.html @@ -149,7 +149,11 @@ damagetypes = "None BFGSplash Drowning Slime"; Default value is true.

doomthingrotationangles (boolean) - GZDB only.
- When set to true, editor actions related to changing thing angle will snap the resulting angle to 45 degree increments.
+ When set to true, editor actions related to changing thing angle will snap the resulting angle to 45 degree increments.
+ Default value is false.
+
+ localsidedeftextureoffsets (boolean) - GZDB only.
+ When set to true, enables in-editor support for individual offsets of upper/middle/lower sidedef textures. Affects UDMF map format only.
Default value is false.

start3dmode (integer)
diff --git a/Source/Core/Config/GameConfiguration.cs b/Source/Core/Config/GameConfiguration.cs index 6e3147f3..1c5da606 100644 --- a/Source/Core/Config/GameConfiguration.cs +++ b/Source/Core/Config/GameConfiguration.cs @@ -89,6 +89,7 @@ namespace CodeImp.DoomBuilder.Config private readonly string actionspecialhelp; //mxd private readonly string thingclasshelp; //mxd private readonly bool sidedefcompressionignoresaction; //mxd + private readonly bool localsidedeftextureoffsets; //MaxW // Skills private readonly List skills; @@ -225,6 +226,8 @@ namespace CodeImp.DoomBuilder.Config public bool HEXEN { get { return hexenmapformat; } } public bool DOOM { get { return doommapformat; } } + public bool UseLocalSidedefTextureOffsets { get { return localsidedeftextureoffsets; } } //MaxW + // Texture/flat/voxel sources public IDictionary TextureRanges { get { return textureranges; } } public IDictionary HiResRanges { get { return hiresranges; } } //mxd @@ -372,6 +375,7 @@ namespace CodeImp.DoomBuilder.Config thingclasshelp = cfg.ReadSetting("thingclasshelp", string.Empty); //mxd sidedefcompressionignoresaction = cfg.ReadSetting("sidedefcompressionignoresaction", false); //mxd defaultlinedefactivation = cfg.ReadSetting("defaultlinedefactivation", ""); //mxd + localsidedeftextureoffsets = (cfg.ReadSetting("localsidedeftextureoffsets", false)); //MaxW for(int i = 0; i < Linedef.NUM_ARGS; i++) makedoorargs[i] = cfg.ReadSetting("makedoorarg" + i.ToString(CultureInfo.InvariantCulture), 0); //mxd. Update map format flags diff --git a/Source/Core/Geometry/Tools.cs b/Source/Core/Geometry/Tools.cs index c18745a5..77774a74 100644 --- a/Source/Core/Geometry/Tools.cs +++ b/Source/Core/Geometry/Tools.cs @@ -1564,7 +1564,7 @@ namespace CodeImp.DoomBuilder.Geometry float totalLength = 0f; foreach(Linedef l in strip) totalLength += l.Length; - if(General.Map.UDMF) + if(General.Map.UDMF && General.Map.Config.UseLocalSidedefTextureOffsets) AutoAlignTexturesOnSidesUdmf(strip, totalLength, (strip[0].End != strip[1].Start)); else AutoAlignTexturesOnSides(strip, totalLength, (strip[0].End != strip[1].Start)); diff --git a/Source/Core/Map/Linedef.cs b/Source/Core/Map/Linedef.cs index 7b9774f5..bd7be0bb 100644 --- a/Source/Core/Map/Linedef.cs +++ b/Source/Core/Map/Linedef.cs @@ -1340,7 +1340,7 @@ namespace CodeImp.DoomBuilder.Map if((oldline.back.MiddleRequired() && oldline.back.LongMiddleTexture != MapSet.EmptyLongName) || oldline.back.HighRequired() || oldline.back.LowRequired()) { int distance = (int)Vector2D.Distance(newline.start.Position, newline.end.Position); - if(General.Map.UDMF) + if(General.Map.UDMF && General.Map.Config.UseLocalSidedefTextureOffsets) { if(distance != 0) oldline.back.SetUdmfTextureOffsetX(distance); } @@ -1354,7 +1354,7 @@ namespace CodeImp.DoomBuilder.Map if(newline.front != null && ((newline.front.MiddleRequired() || newline.front.LongMiddleTexture != MapSet.EmptyLongName) || newline.front.HighRequired() || newline.front.LowRequired())) { int distance = (int)Vector2D.Distance(oldline.start.Position, oldline.end.Position); - if(General.Map.UDMF) + if(General.Map.UDMF && General.Map.Config.UseLocalSidedefTextureOffsets) { if(distance != 0) newline.front.SetUdmfTextureOffsetX(distance); } @@ -1408,7 +1408,7 @@ namespace CodeImp.DoomBuilder.Map newline.front.OffsetY = oldline.front.OffsetY; //mxd. Copy UDMF offsets as well - if(General.Map.UDMF) + if(General.Map.UDMF && General.Map.Config.UseLocalSidedefTextureOffsets) { UniFields.SetFloat(newline.front.Fields, "offsetx_top", oldline.front.Fields.GetValue("offsetx_top", 0f)); UniFields.SetFloat(newline.front.Fields, "offsetx_mid", oldline.front.Fields.GetValue("offsetx_mid", 0f)); @@ -1426,7 +1426,7 @@ namespace CodeImp.DoomBuilder.Map newline.back.OffsetY = oldline.back.OffsetY; //mxd. Copy UDMF offsets as well - if(General.Map.UDMF) + if(General.Map.UDMF && General.Map.Config.UseLocalSidedefTextureOffsets) { UniFields.SetFloat(newline.back.Fields, "offsetx_top", oldline.back.Fields.GetValue("offsetx_top", 0f)); UniFields.SetFloat(newline.back.Fields, "offsetx_mid", oldline.back.Fields.GetValue("offsetx_mid", 0f)); @@ -1446,7 +1446,7 @@ namespace CodeImp.DoomBuilder.Map newline.front.OffsetY = oldline.front.OffsetY; //mxd. Reset UDMF X offset as well - if(General.Map.UDMF) + if(General.Map.UDMF && General.Map.Config.UseLocalSidedefTextureOffsets) { UniFields.SetFloat(newline.front.Fields, "offsetx_top", 0f); UniFields.SetFloat(newline.front.Fields, "offsetx_mid", 0f); @@ -1460,7 +1460,7 @@ namespace CodeImp.DoomBuilder.Map newline.back.OffsetY = oldline.back.OffsetY; //mxd. Reset UDMF X offset and copy Y offset as well - if(General.Map.UDMF) + if(General.Map.UDMF && General.Map.Config.UseLocalSidedefTextureOffsets) { UniFields.SetFloat(newline.back.Fields, "offsetx_top", 0f); UniFields.SetFloat(newline.back.Fields, "offsetx_mid", 0f); @@ -1479,7 +1479,7 @@ namespace CodeImp.DoomBuilder.Map newline.front.OffsetX = 0; newline.front.OffsetY = 0; - if(General.Map.UDMF) + if(General.Map.UDMF && General.Map.Config.UseLocalSidedefTextureOffsets) { UniFields.SetFloat(newline.front.Fields, "offsetx_top", 0f); UniFields.SetFloat(newline.front.Fields, "offsetx_mid", 0f); @@ -1496,7 +1496,7 @@ namespace CodeImp.DoomBuilder.Map newline.back.OffsetX = 0; newline.back.OffsetY = 0; - if(General.Map.UDMF) + if(General.Map.UDMF && General.Map.Config.UseLocalSidedefTextureOffsets) { UniFields.SetFloat(newline.back.Fields, "offsetx_top", 0f); UniFields.SetFloat(newline.back.Fields, "offsetx_mid", 0f); diff --git a/Source/Core/Windows/LinedefEditFormUDMF.cs b/Source/Core/Windows/LinedefEditFormUDMF.cs index 73f9ec2e..03ee0fce 100644 --- a/Source/Core/Windows/LinedefEditFormUDMF.cs +++ b/Source/Core/Windows/LinedefEditFormUDMF.cs @@ -232,6 +232,26 @@ namespace CodeImp.DoomBuilder.Windows pfcBackScaleTop.LinkValues = linkBackTopScale; pfcBackScaleMid.LinkValues = linkBackMidScale; pfcBackScaleBottom.LinkValues = linkBackBottomScale; + + // Disable top/mid/bottom texture offset controls? + if(!General.Map.Config.UseLocalSidedefTextureOffsets) + { + pfcFrontOffsetTop.Enabled = false; + pfcFrontOffsetMid.Enabled = false; + pfcFrontOffsetBottom.Enabled = false; + + pfcBackOffsetTop.Enabled = false; + pfcBackOffsetMid.Enabled = false; + pfcBackOffsetBottom.Enabled = false; + + labelFrontOffsetTop.Enabled = false; + labelFrontOffsetMid.Enabled = false; + labelFrontOffsetBottom.Enabled = false; + + labelBackOffsetTop.Enabled = false; + labelBackOffsetMid.Enabled = false; + labelBackOffsetBottom.Enabled = false; + } } #endregion diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs index 159f56df..9ca42b5f 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs @@ -1468,9 +1468,9 @@ namespace CodeImp.DoomBuilder.BuilderModes undoticket = mode.CreateUndo("Change texture offsets"); //mxd - if(General.Map.UDMF) + if(General.Map.UDMF && General.Map.Config.UseLocalSidedefTextureOffsets) { - // Apply UDMF offsets + // Apply per-texture offsets MoveTextureOffset(new Point(-horizontal, -vertical)); Point p = GetTextureOffset(); mode.SetActionResult("Changed texture offsets to " + p.X + ", " + p.Y + "."); diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs index 0525a68a..dec56450 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs @@ -1553,7 +1553,8 @@ namespace CodeImp.DoomBuilder.BuilderModes List objs = GetSelectedObjects(false, true, false, false); //mxd. Because Upper/Middle/Lower textures offsets should be threated separately in UDMF - if(General.Map.UDMF) + //MaxW. But they're not for Eternity, so this needs its own config setting + if(General.Map.UDMF && General.Map.Config.UseLocalSidedefTextureOffsets) { HashSet donesides = new HashSet(); foreach(IVisualEventReceiver i in objs) @@ -3710,7 +3711,7 @@ namespace CodeImp.DoomBuilder.BuilderModes //mxd. If checkSelectedSidedefParts is set to true, only selected linedef parts will be aligned (when a sidedef has both top and bottom parts, but only bottom is selected, top texture won't be aligned) internal void AutoAlignTextures(BaseVisualGeometrySidedef start, ImageData texture, bool alignx, bool aligny, bool resetsidemarks, bool checkSelectedSidedefParts) { - if(General.Map.UDMF) + if(General.Map.UDMF && General.Map.Config.UseLocalSidedefTextureOffsets) AutoAlignTexturesUDMF(start, texture, alignx, aligny, resetsidemarks, checkSelectedSidedefParts); else AutoAlignTextures(start, texture, alignx, aligny, resetsidemarks);