diff --git a/Build/Configurations/Includes/Eternity_misc.cfg b/Build/Configurations/Includes/Eternity_misc.cfg index 76f47243..e725508f 100755 --- a/Build/Configurations/Includes/Eternity_misc.cfg +++ b/Build/Configurations/Includes/Eternity_misc.cfg @@ -393,7 +393,11 @@ linedefflags_udmf linedefactivations_udmf { - repeatspecial = "Repeatable action"; + repeatspecial + { + name = "Repeatable action"; + istrigger = false; + } playeruse = "When player presses use"; playercross = "When player walks over"; playerpush = "When player bumps"; @@ -405,8 +409,16 @@ linedefactivations_udmf polycross = "When polyobject moves over"; impact = "On projectile impact"; // checkswitchrange = "Switch height check"; - passuse = "Pass use on"; - firstsideonly = "Front side only"; + passuse + { + name = "Pass use on"; + istrigger = false; + } + firstsideonly + { + name = "Front side only"; + istrigger = false; + } // playeruseback = "Player can use from back side"; } diff --git a/Build/Configurations/Includes/UDMF_misc.cfg b/Build/Configurations/Includes/UDMF_misc.cfg index acf495d0..589cb9dc 100755 --- a/Build/Configurations/Includes/UDMF_misc.cfg +++ b/Build/Configurations/Includes/UDMF_misc.cfg @@ -110,8 +110,16 @@ linedefactivations playerpush = "When player bumps"; monsterpush = "When monsters bumps"; missilecross = "When projectile crosses"; - repeatspecial = "Repeatable action"; - passuse = "Pass use on"; + repeatspecial + { + name = "Repeatable action"; + istrigger = false; + } + passuse + { + name = "Pass use on"; + istrigger = false; + } } sidedefflags diff --git a/Build/Configurations/Includes/ZDoom_misc.cfg b/Build/Configurations/Includes/ZDoom_misc.cfg index 86e2a1c2..e295ff43 100755 --- a/Build/Configurations/Includes/ZDoom_misc.cfg +++ b/Build/Configurations/Includes/ZDoom_misc.cfg @@ -56,7 +56,11 @@ linedefflags_udmf linedefactivations_udmf { - repeatspecial = "Repeatable action"; + repeatspecial + { + name = "Repeatable action"; + istrigger = false; + } playeruse = "When player presses use"; playercross = "When player walks over"; playerpush = "When player bumps"; @@ -66,10 +70,26 @@ linedefactivations_udmf anycross = "Any crossing non-missile activates"; missilecross = "When projectile crosses"; impact = "On projectile impact"; - checkswitchrange = "Switch height check"; - passuse = "Pass use on"; - firstsideonly = "Front side only"; - playeruseback = "Player can use from back side"; + checkswitchrange + { + name = "Switch height check"; + istrigger = false; + } + passuse + { + name = "Pass use on"; + istrigger = false; + } + firstsideonly + { + name = "Front side only"; + istrigger = false; + } + playeruseback + { + name = "Player can use from back side"; + istrigger = false; + } } diff --git a/Source/Core/Config/GameConfiguration.cs b/Source/Core/Config/GameConfiguration.cs index f4ac1788..d27fee75 100755 --- a/Source/Core/Config/GameConfiguration.cs +++ b/Source/Core/Config/GameConfiguration.cs @@ -19,6 +19,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Collections.Specialized; using System.Globalization; using System.Linq; using System.Reflection; @@ -745,8 +746,18 @@ namespace CodeImp.DoomBuilder.Config IDictionary dic = cfg.ReadSetting("linedefactivations", new Hashtable()); foreach(DictionaryEntry de in dic) { - // Add to the list - linedefactivates.Add(new LinedefActivateInfo(de.Key.ToString(), de.Value.ToString())); + // If the value is a dictionary read the values from that + if (de.Value is ICollection) + { + string name = cfg.ReadSetting("linedefactivations." + de.Key.ToString() + ".name", de.Key.ToString()); + bool istrigger = cfg.ReadSetting("linedefactivations." + de.Key.ToString() + ".istrigger", true); + linedefactivates.Add(new LinedefActivateInfo(de.Key.ToString(), name, istrigger)); + } + else + { + // Add to the list + linedefactivates.Add(new LinedefActivateInfo(de.Key.ToString(), de.Value.ToString(), true)); + } } //mxd. Sort only when activations are numeric diff --git a/Source/Core/Config/LinedefActivateInfo.cs b/Source/Core/Config/LinedefActivateInfo.cs index 32c3f251..d456deaf 100755 --- a/Source/Core/Config/LinedefActivateInfo.cs +++ b/Source/Core/Config/LinedefActivateInfo.cs @@ -34,6 +34,7 @@ namespace CodeImp.DoomBuilder.Config private int intkey; private string key; private string title; + private bool istrigger; #endregion @@ -42,17 +43,19 @@ namespace CodeImp.DoomBuilder.Config public int Index { get { return intkey; } } public string Key { get { return key; } } public string Title { get { return title; } } + public bool IsTrigger { get { return istrigger; } } #endregion #region ================== Constructor / Disposer // Constructor - internal LinedefActivateInfo(string key, string title) + internal LinedefActivateInfo(string key, string title, bool istrigger) { // Initialize this.key = key; this.title = title; + this.istrigger = istrigger; // Try parsing key as int for comparison if(!int.TryParse(key, out intkey)) intkey = 0; diff --git a/Source/Core/Windows/LinedefColorPresetsForm.cs b/Source/Core/Windows/LinedefColorPresetsForm.cs index 60f4cfb7..4d95315b 100755 --- a/Source/Core/Windows/LinedefColorPresetsForm.cs +++ b/Source/Core/Windows/LinedefColorPresetsForm.cs @@ -99,7 +99,7 @@ namespace CodeImp.DoomBuilder.Windows if(activations.Count > 0) { - activations.Insert(0, new LinedefActivateInfo("-1", "Any activation")); + activations.Insert(0, new LinedefActivateInfo("-1", "Any activation", true)); if(General.Map.UDMF) { diff --git a/Source/Core/Windows/LinedefEditFormUDMF.cs b/Source/Core/Windows/LinedefEditFormUDMF.cs index ad1e0fde..5f9a87c3 100755 --- a/Source/Core/Windows/LinedefEditFormUDMF.cs +++ b/Source/Core/Windows/LinedefEditFormUDMF.cs @@ -617,7 +617,8 @@ namespace CodeImp.DoomBuilder.Windows bool haveactivationflag = false; foreach(CheckBox c in udmfactivates.Checkboxes) { - if(c.CheckState != CheckState.Unchecked) + LinedefActivateInfo ai = (c.Tag as LinedefActivateInfo); + if(ai.IsTrigger && c.CheckState != CheckState.Unchecked) { haveactivationflag = true; break; @@ -625,7 +626,13 @@ namespace CodeImp.DoomBuilder.Windows } missingactivation.Visible = !haveactivationflag; - activationGroup.ForeColor = (!haveactivationflag ? Color.DarkRed : SystemColors.ControlText); + + foreach (CheckBox c in udmfactivates.Checkboxes) + { + LinedefActivateInfo ai = (c.Tag as LinedefActivateInfo); + if (ai.IsTrigger) + c.ForeColor = (!haveactivationflag ? Color.DarkRed : SystemColors.ControlText); + } } else { diff --git a/Source/Plugins/BuilderModes/ErrorChecks/CheckMissingActivations.cs b/Source/Plugins/BuilderModes/ErrorChecks/CheckMissingActivations.cs index 70630a58..979b864e 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/CheckMissingActivations.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/CheckMissingActivations.cs @@ -31,7 +31,7 @@ namespace CodeImp.DoomBuilder.BuilderModes return; } - // Go for all vertices + // Go for all linedefs foreach (Linedef l in General.Map.Map.Linedefs) { int action = l.Action; @@ -43,7 +43,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { foreach (LinedefActivateInfo ai in General.Map.Config.LinedefActivates) { - if (flags.ContainsKey(ai.Key) && flags[ai.Key] == true) + if (flags.ContainsKey(ai.Key) && flags[ai.Key] == true && ai.IsTrigger) { hasActivation = true; break;