From e62da4e6b2997682c6c780bf2acdca8e24d4856b Mon Sep 17 00:00:00 2001 From: MaxED Date: Mon, 16 Nov 2015 08:14:35 +0000 Subject: [PATCH] Fixed, Linedef Color Presets window: Linedef Actions and Linedef Activations lists were accidentally modified during window initialization. --- .../Core/Windows/LinedefColorPresetsForm.cs | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Source/Core/Windows/LinedefColorPresetsForm.cs b/Source/Core/Windows/LinedefColorPresetsForm.cs index 3d29c0a5..a9b8e7cd 100644 --- a/Source/Core/Windows/LinedefColorPresetsForm.cs +++ b/Source/Core/Windows/LinedefColorPresetsForm.cs @@ -74,7 +74,7 @@ namespace CodeImp.DoomBuilder.Windows // Setup preset controls // Add flags - foreach (KeyValuePair lf in General.Map.Config.LinedefFlags) + foreach(KeyValuePair lf in General.Map.Config.LinedefFlags) { CheckBox box = flags.Add(lf.Value, lf.Key); box.ThreeState = true; @@ -84,9 +84,8 @@ namespace CodeImp.DoomBuilder.Windows // Fill actions list action.GeneralizedCategories = General.Map.Config.GenActionCategories; - LinedefActionInfo anyAction = new LinedefActionInfo(-1, "Any action", true, false); - List infos = General.Map.Config.SortedLinedefActions; - infos.Insert(0, anyAction); + List infos = new List { new LinedefActionInfo(-1, "Any action", true, false) }; + infos.AddRange(General.Map.Config.SortedLinedefActions); action.AddInfo(infos.ToArray()); action.Value = -1; @@ -96,7 +95,7 @@ namespace CodeImp.DoomBuilder.Windows activation.Visible = !General.Map.UDMF; //get activates - List activations = General.Map.Config.LinedefActivates; + List activations = new List(General.Map.Config.LinedefActivates); if(activations.Count > 0) { @@ -104,7 +103,7 @@ namespace CodeImp.DoomBuilder.Windows if(General.Map.UDMF) { - foreach (LinedefActivateInfo ai in General.Map.Config.LinedefActivates) + foreach(LinedefActivateInfo ai in General.Map.Config.LinedefActivates) { CheckBox box = udmfactivates.Add(ai.Title, ai.Key); box.ThreeState = true; @@ -159,12 +158,12 @@ namespace CodeImp.DoomBuilder.Windows if(other.Preset.Flags.Count != item.Preset.Flags.Count) continue; if(other.Preset.RestrictedFlags.Count != item.Preset.RestrictedFlags.Count) continue; - bool gotMismatch = false; + bool gotmismatch = false; foreach(string flag in other.Preset.Flags) { if(!item.Preset.Flags.Contains(flag)) { - gotMismatch = true; + gotmismatch = true; break; } } @@ -173,12 +172,12 @@ namespace CodeImp.DoomBuilder.Windows { if(!item.Preset.RestrictedFlags.Contains(flag)) { - gotMismatch = true; + gotmismatch = true; break; } } - if(gotMismatch) continue; + if(gotmismatch) continue; //we have a match warning = "Preset matches '" + other.Preset.Name + "'!"; @@ -225,7 +224,7 @@ namespace CodeImp.DoomBuilder.Windows } else { - foreach (CheckBox box in source.Checkboxes) + foreach(CheckBox box in source.Checkboxes) { string flag = box.Tag.ToString(); if(preset.Flags.Contains(flag)) preset.Flags.Remove(flag);