diff --git a/Build/Configurations/Includes/SRB222_misc.cfg b/Build/Configurations/Includes/SRB222_misc.cfg index 0b94a5a87a37a5ce7cf6a2a4c9e5799f7c738eab..37b01d7dd56eadaeb1eb3ae4759fb74efc79e61f 100644 --- a/Build/Configurations/Includes/SRB222_misc.cfg +++ b/Build/Configurations/Includes/SRB222_misc.cfg @@ -590,6 +590,12 @@ universalfields type = 3; default = false; } + + triggertag + { + type = 0; + default = 0; + } } } diff --git a/Source/Core/Windows/LinedefEditFormSRB2.Designer.cs b/Source/Core/Windows/LinedefEditFormSRB2.Designer.cs index c3c629b54dc893dd2ed9ba68c81d3a3e74c3fe0f..ae5617b964a2ded4d5d835531c2b3adc77ef1695 100644 --- a/Source/Core/Windows/LinedefEditFormSRB2.Designer.cs +++ b/Source/Core/Windows/LinedefEditFormSRB2.Designer.cs @@ -289,9 +289,9 @@ namespace CodeImp.DoomBuilder.Windows // executordelay // this.executordelay.AllowDecimal = false; - this.executordelay.AllowExpressions = false; + this.executordelay.AllowExpressions = true; this.executordelay.AllowNegative = false; - this.executordelay.AllowRelative = false; + this.executordelay.AllowRelative = true; this.executordelay.ButtonStep = 1; this.executordelay.ButtonStepBig = 35F; this.executordelay.ButtonStepFloat = 1F; diff --git a/Source/Core/Windows/LinedefEditFormSRB2.cs b/Source/Core/Windows/LinedefEditFormSRB2.cs index f3c6db8376dd036135bcef10e84e5d2f11fc0d48..4e82c44cacbaf68d5cbb1e03131280ded027bccf 100644 --- a/Source/Core/Windows/LinedefEditFormSRB2.cs +++ b/Source/Core/Windows/LinedefEditFormSRB2.cs @@ -908,6 +908,9 @@ namespace CodeImp.DoomBuilder.Windows MakeUndo(); //mxd int i = 0; + // Reset increment steps, otherwise it's just keep counting and counting + executordelay.ResetIncrementStep(); + //restore values if (string.IsNullOrEmpty(executordelay.Text)) { @@ -918,7 +921,7 @@ namespace CodeImp.DoomBuilder.Windows { foreach (Linedef l in lines) { - UniFields.SetInteger(l.Fields, "executordelay", executordelay.GetResult(0), 0); + UniFields.SetInteger(l.Fields, "executordelay", executordelay.GetResult(l.Fields.GetValue("executordelay", 0)), 0); } } diff --git a/Source/Core/Windows/SectorEditFormSRB2.Designer.cs b/Source/Core/Windows/SectorEditFormSRB2.Designer.cs index 18f6d290d24d561308037a350a39e409dfb41876..d828f0b8413dd20583702eead68adb73a2991dce 100644 --- a/Source/Core/Windows/SectorEditFormSRB2.Designer.cs +++ b/Source/Core/Windows/SectorEditFormSRB2.Designer.cs @@ -224,9 +224,9 @@ // triggerTag // this.triggerTag.AllowDecimal = false; - this.triggerTag.AllowExpressions = false; + this.triggerTag.AllowExpressions = true; this.triggerTag.AllowNegative = false; - this.triggerTag.AllowRelative = false; + this.triggerTag.AllowRelative = true; this.triggerTag.ButtonStep = 1; this.triggerTag.ButtonStepBig = 1F; this.triggerTag.ButtonStepFloat = 1F; @@ -238,6 +238,7 @@ this.triggerTag.Size = new System.Drawing.Size(81, 24); this.triggerTag.StepValues = null; this.triggerTag.TabIndex = 20; + this.triggerTag.WhenTextChanged += new System.EventHandler(this.triggerTag_WhenTextChanged); // // label16 // diff --git a/Source/Core/Windows/SectorEditFormSRB2.cs b/Source/Core/Windows/SectorEditFormSRB2.cs index e0f160a53e634f979694bd6ed2fbae464da4ff19..b6bc69c3f9e649e915ef1e20634120be3b2bbb8b 100644 --- a/Source/Core/Windows/SectorEditFormSRB2.cs +++ b/Source/Core/Windows/SectorEditFormSRB2.cs @@ -62,6 +62,7 @@ namespace CodeImp.DoomBuilder.Windows public readonly int FadeAlpha; public readonly int FadeStart; public readonly int FadeEnd; + public readonly int TriggerTag; //UDMF Ceiling public readonly double CeilOffsetX; @@ -108,6 +109,7 @@ namespace CodeImp.DoomBuilder.Windows FadeAlpha = UniFields.GetInteger(s.Fields, "fadealpha", General.Map.Config.MaxColormapAlpha); FadeStart = UniFields.GetInteger(s.Fields, "fadestart", 0); FadeEnd = UniFields.GetInteger(s.Fields, "fadeend", General.Map.Config.NumBrightnessLevels - 1); + TriggerTag = UniFields.GetInteger(s.Fields, "triggertag", 0); //UDMF Ceiling CeilOffsetX = UniFields.GetFloat(s.Fields, "xpanningceiling", 0.0); @@ -746,9 +748,6 @@ namespace CodeImp.DoomBuilder.Windows if (!string.IsNullOrEmpty(friction.Text)) UniFields.SetFloat(s.Fields, "friction", friction.GetResultFloat(s.Fields.GetValue("friction", 0.90625)), 0.90625); - if (!string.IsNullOrEmpty(triggerTag.Text)) - UniFields.SetInteger(s.Fields, "triggertag", triggerTag.GetResult(s.Fields.GetValue("triggertag", 0)), 0); - if (!string.IsNullOrEmpty(triggerer.Text)) UniFields.SetString(s.Fields, "triggerer", triggerer.Text, TRIGGERER_DEFAULT); @@ -1799,7 +1798,34 @@ namespace CodeImp.DoomBuilder.Windows floorslopecontrol.StepValues = (floorslopecontrol.UseLineAngles ? anglesteps : null); } + private void triggerTag_WhenTextChanged(object sender, EventArgs e) + { + if (preventchanges) return; + MakeUndo(); //mxd + + // Reset increment steps, otherwise it's just keep counting and counting + triggerTag.ResetIncrementStep(); + + //restore values + if (string.IsNullOrEmpty(triggerTag.Text)) + { + foreach (Sector s in sectors) + { + UniFields.SetInteger(s.Fields, "triggertag", sectorprops[s].TriggerTag, 0); + s.UpdateNeeded = true; + } + } + else //update values + { + foreach (Sector s in sectors) + { + UniFields.SetInteger(s.Fields, "triggertag", triggerTag.GetResult(sectorprops[s].TriggerTag), 0); + s.UpdateNeeded = true; + } + } + } + #endregion - } + } }