From 99f6a9a5a88c349206247d41fa726884d74667e8 Mon Sep 17 00:00:00 2001 From: MaxED Date: Fri, 12 Sep 2014 21:08:11 +0000 Subject: [PATCH] Map Analysis mode: results can now be hidden individually. Updated documentation. --- Help/gzdb/features/features.html | 7 ++- Source/Core/Map/MapElement.cs | 5 ++ .../BuilderModes/ErrorChecks/ErrorResult.cs | 14 +++-- .../ErrorChecks/ResultLineMissingFront.cs | 30 ++++++--- .../ErrorChecks/ResultLineMissingSides.cs | 41 ++++++++----- .../ErrorChecks/ResultLineNotDoubleSided.cs | 26 +++++--- .../ErrorChecks/ResultLineNotSingleSided.cs | 19 ++++-- .../ErrorChecks/ResultLineOverlapping.cs | 31 +++++++--- .../ErrorChecks/ResultMissingFlat.cs | 15 ++++- .../ErrorChecks/ResultMissingTexture.cs | 15 ++++- .../ErrorChecks/ResultNoErrors.cs | 3 + .../ErrorChecks/ResultSectorInvalid.cs | 17 ++++- .../ErrorChecks/ResultSectorUnclosed.cs | 27 +++++--- .../ErrorChecks/ResultStrayVertex.cs | 54 +++++++++++++--- .../ErrorChecks/ResultStuckThingInLine.cs | 19 ++++-- .../ErrorChecks/ResultStuckThingInThing.cs | 23 ++++++- .../ErrorChecks/ResultThingOutside.cs | 19 ++++-- .../ErrorChecks/ResultUnknownFlat.cs | 16 ++++- .../ErrorChecks/ResultUnknownTexture.cs | 15 ++++- .../ErrorChecks/ResultUnknownThing.cs | 58 ++++++++++++++---- .../ErrorChecks/ResultUnusedTexture.cs | 15 ++++- .../ResultVertexOverlappingLine.cs | 42 ++++++++++--- .../ResultVertexOverlappingVertex.cs | 42 ++++++++++--- .../Interface/ErrorCheckForm.Designer.cs | 31 +++++++--- .../BuilderModes/Interface/ErrorCheckForm.cs | 21 ++++++- .../Properties/Resources.Designer.cs | 9 ++- .../BuilderModes/Properties/Resources.resx | 17 ++--- .../BuilderModes/Resources/HideAll.png | Bin 0 -> 1678 bytes 28 files changed, 487 insertions(+), 144 deletions(-) create mode 100644 Source/Plugins/BuilderModes/Resources/HideAll.png diff --git a/Help/gzdb/features/features.html b/Help/gzdb/features/features.html index ddbd2561..e03bcc40 100644 --- a/Help/gzdb/features/features.html +++ b/Help/gzdb/features/features.html @@ -289,15 +289,16 @@
  • Map Analysis mode:

  • diff --git a/Source/Core/Map/MapElement.cs b/Source/Core/Map/MapElement.cs index f4544aae..e85c0999 100644 --- a/Source/Core/Map/MapElement.cs +++ b/Source/Core/Map/MapElement.cs @@ -44,6 +44,9 @@ namespace CodeImp.DoomBuilder.Map // Disposing protected bool isdisposed; + // Error Ignoring (mxd) + private List ignorederrorchecks; + #endregion #region ================== Properties @@ -52,6 +55,7 @@ namespace CodeImp.DoomBuilder.Map public UniFields Fields { get { return fields; } } public bool Marked { get { return marked; } set { marked = value; } } public bool IsDisposed { get { return isdisposed; } } + public List IgnoredErrorChecks { get { return ignorederrorchecks; } } //mxd #endregion @@ -62,6 +66,7 @@ namespace CodeImp.DoomBuilder.Map { // Initialize fields = new UniFields(this); + ignorederrorchecks = new List(); //mxd } // Disposer diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ErrorResult.cs b/Source/Plugins/BuilderModes/ErrorChecks/ErrorResult.cs index d56d288f..95d6f182 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ErrorResult.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ErrorResult.cs @@ -27,12 +27,13 @@ using System.Drawing; namespace CodeImp.DoomBuilder.BuilderModes { - public class ErrorResult + public abstract class ErrorResult { #region ================== Variables protected string description; - protected List viewobjects; + protected readonly List viewobjects; + protected bool hidden; #endregion @@ -45,13 +46,14 @@ namespace CodeImp.DoomBuilder.BuilderModes public virtual string Button1Text { get { return ""; } } public virtual string Button2Text { get { return ""; } } public virtual string Button3Text { get { return ""; } } - + public bool IsHidden { get { return hidden; } } + #endregion #region ================== Constructor / Destructor // Constructor - public ErrorResult() + protected ErrorResult() { // Initialize viewobjects = new List(1); @@ -177,7 +179,9 @@ namespace CodeImp.DoomBuilder.BuilderModes ClassicMode editmode = (General.Editing.Mode as ClassicMode); editmode.CenterOnArea(area, 0.6f); } - + + internal abstract void Hide(bool hide); //mxd. Marks map elements of this result as hidden in ErrorCheckForm + #endregion } } diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultLineMissingFront.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultLineMissingFront.cs index 7502d582..d609c527 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultLineMissingFront.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultLineMissingFront.cs @@ -16,6 +16,7 @@ #region ================== Namespaces +using System; using System.Collections.Generic; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; @@ -29,9 +30,9 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Linedef line; - private int buttons; - private Sidedef copysidedef; + private readonly Linedef line; + private readonly int buttons; + private readonly Sidedef copysidedef; #endregion @@ -49,11 +50,12 @@ namespace CodeImp.DoomBuilder.BuilderModes public ResultLineMissingFront(Linedef l) { // Initialize - this.line = l; - this.viewobjects.Add(l); - this.description = "This linedef has a back sidedef, but is missing a front sidedef. " + - "A line must have at least a front side and optionally a back side! " + - "Click 'Flip Linedef' button if the line is supposed to be single-sided."; + line = l; + viewobjects.Add(l); + hidden = l.IgnoredErrorChecks.Contains(this.GetType()); //mxd + description = "This linedef has a back sidedef, but is missing a front sidedef. " + + "A line must have at least a front side and optionally a back side! " + + "Click 'Flip Linedef' button if the line is supposed to be single-sided."; // One solution is to flip the sidedefs buttons = 1; @@ -73,7 +75,8 @@ namespace CodeImp.DoomBuilder.BuilderModes fixable = true; break; } - else if(!sd.Front && (sd.Line.Back != null)) + + if(!sd.Front && (sd.Line.Back != null)) { copysidedef = sd.Line.Back; fixable = true; @@ -93,6 +96,15 @@ namespace CodeImp.DoomBuilder.BuilderModes #endregion #region ================== Methods + + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if (hide) line.IgnoredErrorChecks.Add(t); + else if(line.IgnoredErrorChecks.Contains(t)) line.IgnoredErrorChecks.Remove(t); + } // This must return the string that is displayed in the listbox public override string ToString() diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultLineMissingSides.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultLineMissingSides.cs index 41ec2043..c226cc9f 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultLineMissingSides.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultLineMissingSides.cs @@ -16,6 +16,7 @@ #region ================== Namespaces +using System; using System.Collections.Generic; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; @@ -29,10 +30,10 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Linedef line; - private int buttons; - private Sidedef copysidedeffront; - private Sidedef copysidedefback; + private readonly Linedef line; + private readonly int buttons; + private readonly Sidedef copysidedeffront; + private readonly Sidedef copysidedefback; #endregion @@ -49,20 +50,19 @@ namespace CodeImp.DoomBuilder.BuilderModes // Constructor public ResultLineMissingSides(Linedef l) { - List sides; - bool fixable; - // Initialize - this.line = l; - this.viewobjects.Add(l); - this.description = "This linedef is missing front and back sidedefs." + - "A line must have at least a front side and optionally a back side!"; + line = l; + viewobjects.Add(l); + hidden = l.IgnoredErrorChecks.Contains(this.GetType()); //mxd + description = "This linedef is missing front and back sidedefs." + + "A line must have at least a front side and optionally a back side!"; buttons = 0; // Check if we can join a sector on the front side - fixable = false; - sides = Tools.FindPotentialSectorAt(l, true); + bool fixable = false; + List sides = Tools.FindPotentialSectorAt(l, true); + if(sides != null) { foreach(LinedefSide sd in sides) @@ -75,7 +75,8 @@ namespace CodeImp.DoomBuilder.BuilderModes fixable = true; break; } - else if(!sd.Front && (sd.Line.Back != null)) + + if(!sd.Front && (sd.Line.Back != null)) { copysidedeffront = sd.Line.Back; fixable = true; @@ -102,7 +103,8 @@ namespace CodeImp.DoomBuilder.BuilderModes fixable = true; break; } - else if(!sd.Front && (sd.Line.Back != null)) + + if(!sd.Front && (sd.Line.Back != null)) { copysidedefback = sd.Line.Back; fixable = true; @@ -126,6 +128,15 @@ namespace CodeImp.DoomBuilder.BuilderModes #endregion #region ================== Methods + + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) line.IgnoredErrorChecks.Add(t); + else if(line.IgnoredErrorChecks.Contains(t)) line.IgnoredErrorChecks.Remove(t); + } // This must return the string that is displayed in the listbox public override string ToString() diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultLineNotDoubleSided.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultLineNotDoubleSided.cs index 1c019fb8..e3706462 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultLineNotDoubleSided.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultLineNotDoubleSided.cs @@ -16,6 +16,7 @@ #region ================== Namespaces +using System; using System.Collections.Generic; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; @@ -29,9 +30,9 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Linedef line; - private int buttons; - private Sidedef copysidedef; + private readonly Linedef line; + private readonly int buttons; + private readonly Sidedef copysidedef; #endregion @@ -49,9 +50,10 @@ namespace CodeImp.DoomBuilder.BuilderModes public ResultLineNotDoubleSided(Linedef l) { // Initialize - this.line = l; - this.viewobjects.Add(l); - this.description = "This linedef is marked as double-sided, but is missing the back sidedef. Click 'Make Single-Sided' button to remove the double-sided flag from the line."; + line = l; + viewobjects.Add(l); + hidden = l.IgnoredErrorChecks.Contains(this.GetType()); //mxd + description = "This linedef is marked as double-sided, but is missing the back sidedef. Click 'Make Single-Sided' button to remove the double-sided flag from the line."; // One solution is to remove the double-sided flag buttons = 1; @@ -71,7 +73,8 @@ namespace CodeImp.DoomBuilder.BuilderModes fixable = true; break; } - else if(!sd.Front && (sd.Line.Back != null)) + + if(!sd.Front && (sd.Line.Back != null)) { copysidedef = sd.Line.Back; fixable = true; @@ -91,6 +94,15 @@ namespace CodeImp.DoomBuilder.BuilderModes #endregion #region ================== Methods + + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) line.IgnoredErrorChecks.Add(t); + else if(line.IgnoredErrorChecks.Contains(t)) line.IgnoredErrorChecks.Remove(t); + } // This must return the string that is displayed in the listbox public override string ToString() diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultLineNotSingleSided.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultLineNotSingleSided.cs index 49da4f5c..0499ec4a 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultLineNotSingleSided.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultLineNotSingleSided.cs @@ -16,6 +16,7 @@ #region ================== Namespaces +using System; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; @@ -27,7 +28,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Linedef line; + private readonly Linedef line; #endregion @@ -45,15 +46,25 @@ namespace CodeImp.DoomBuilder.BuilderModes public ResultLineNotSingleSided(Linedef l) { // Initialize - this.line = l; - this.viewobjects.Add(l); - this.description = "This linedef is marked as single-sided, but has both a front and a back sidedef. Click 'Make Double-Sided' button to flag the line as double-sided." + + line = l; + viewobjects.Add(l); + hidden = l.IgnoredErrorChecks.Contains(this.GetType()); //mxd + description = "This linedef is marked as single-sided, but has both a front and a back sidedef. Click 'Make Double-Sided' button to flag the line as double-sided." + " Or click 'Remove Sidedef' button to remove the sidedef on the back side (making the line really single-sided)."; } #endregion #region ================== Methods + + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) line.IgnoredErrorChecks.Add(t); + else if(line.IgnoredErrorChecks.Contains(t)) line.IgnoredErrorChecks.Remove(t); + } // This must return the string that is displayed in the listbox public override string ToString() diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultLineOverlapping.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultLineOverlapping.cs index b18bc52a..da7fb75e 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultLineOverlapping.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultLineOverlapping.cs @@ -16,6 +16,7 @@ #region ================== Namespaces +using System; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; @@ -27,8 +28,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Linedef line1; - private Linedef line2; + private readonly Linedef line1; + private readonly Linedef line2; #endregion @@ -44,16 +45,32 @@ namespace CodeImp.DoomBuilder.BuilderModes public ResultLineOverlapping(Linedef l1, Linedef l2) { // Initialize - this.line1 = l1; - this.line2 = l2; - this.viewobjects.Add(l1); - this.viewobjects.Add(l2); - this.description = "These linedefs are overlapping and they do not reference the same sector on all sides. Overlapping lines is only allowed when they reference the same sector on all sides."; + line1 = l1; + line2 = l2; + viewobjects.Add(l1); + viewobjects.Add(l2); + hidden = (l1.IgnoredErrorChecks.Contains(this.GetType()) && l2.IgnoredErrorChecks.Contains(this.GetType())); //mxd + description = "These linedefs are overlapping and they do not reference the same sector on all sides. Overlapping lines is only allowed when they reference the same sector on all sides."; } #endregion #region ================== Methods + + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) { + hidden = hide; + Type t = this.GetType(); + if (hide) { + line1.IgnoredErrorChecks.Add(t); + line2.IgnoredErrorChecks.Add(t); + } + else + { + if (line1.IgnoredErrorChecks.Contains(t)) line1.IgnoredErrorChecks.Remove(t); + if (line2.IgnoredErrorChecks.Contains(t)) line2.IgnoredErrorChecks.Remove(t); + } + } // This must return the string that is displayed in the listbox public override string ToString() diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultMissingFlat.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultMissingFlat.cs index 7bbaabac..28bb6c55 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultMissingFlat.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultMissingFlat.cs @@ -1,5 +1,6 @@ #region ================== Namespaces +using System; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; @@ -11,8 +12,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Sector sector; - private bool ceiling; + private readonly Sector sector; + private readonly bool ceiling; #endregion @@ -32,6 +33,7 @@ namespace CodeImp.DoomBuilder.BuilderModes this.sector = s; this.ceiling = ceiling; this.viewobjects.Add(s); + this.hidden = s.IgnoredErrorChecks.Contains(this.GetType()); //mxd string objname = ceiling ? "ceiling" : "floor"; this.description = "This sector's " + objname + " is missing a flat where it is required and could cause a 'Hall Of Mirrors' visual problem in the map. Click the 'Add Default Flat' button to add a flat to the sector."; @@ -40,6 +42,15 @@ namespace CodeImp.DoomBuilder.BuilderModes #endregion #region ================== Methods + + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if (hide) sector.IgnoredErrorChecks.Add(t); + else if (sector.IgnoredErrorChecks.Contains(t)) sector.IgnoredErrorChecks.Remove(t); + } // This must return the string that is displayed in the listbox public override string ToString() diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultMissingTexture.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultMissingTexture.cs index 28841ea0..2fd77c79 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultMissingTexture.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultMissingTexture.cs @@ -16,6 +16,7 @@ #region ================== Namespaces +using System; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; @@ -27,8 +28,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Sidedef side; - private SidedefPart part; + private readonly Sidedef side; + private readonly SidedefPart part; #endregion @@ -48,6 +49,7 @@ namespace CodeImp.DoomBuilder.BuilderModes this.side = sd; this.part = part; this.viewobjects.Add(sd); + this.hidden = sd.IgnoredErrorChecks.Contains(this.GetType()); //mxd this.description = "This sidedef is missing a texture where it is required and could cause a 'Hall Of Mirrors' visual problem in the map. Click the 'Add Default Texture' button to add a texture to the line."; } @@ -55,6 +57,15 @@ namespace CodeImp.DoomBuilder.BuilderModes #region ================== Methods + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) side.IgnoredErrorChecks.Add(t); + else if(side.IgnoredErrorChecks.Contains(t)) side.IgnoredErrorChecks.Remove(t); + } + // This must return the string that is displayed in the listbox public override string ToString() { diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultNoErrors.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultNoErrors.cs index c68b5202..01571242 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultNoErrors.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultNoErrors.cs @@ -43,6 +43,9 @@ namespace CodeImp.DoomBuilder.BuilderModes #region ================== Methods + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) { } + // This must return the string that is displayed in the listbox public override string ToString() { diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultSectorInvalid.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultSectorInvalid.cs index e62272a3..46b2b9f7 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultSectorInvalid.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultSectorInvalid.cs @@ -1,5 +1,6 @@ #region ================== Namespaces +using System; using System.Collections.Generic; using CodeImp.DoomBuilder.Geometry; using CodeImp.DoomBuilder.Map; @@ -30,14 +31,24 @@ namespace CodeImp.DoomBuilder.BuilderModes public ResultSectorInvalid(Sector s) { // Initialize - this.sector = s; - this.viewobjects.Add(s); - this.description = "This sector has invalid geometry (it has less than 3 sidedefs or it's area is 0). This could cause problems with clipping and rendering in the game."; + sector = s; + viewobjects.Add(s); + hidden = s.IgnoredErrorChecks.Contains(this.GetType()); //mxd + description = "This sector has invalid geometry (it has less than 3 sidedefs or it's area is 0). This could cause problems with clipping and rendering in the game."; } #endregion #region ================== Methods + + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) sector.IgnoredErrorChecks.Add(t); + else if(sector.IgnoredErrorChecks.Contains(t)) sector.IgnoredErrorChecks.Remove(t); + } // This must return the string that is displayed in the listbox public override string ToString() { diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultSectorUnclosed.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultSectorUnclosed.cs index 3e9eded9..bacb6ebb 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultSectorUnclosed.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultSectorUnclosed.cs @@ -16,6 +16,7 @@ #region ================== Namespaces +using System; using System.Collections.Generic; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; @@ -28,9 +29,9 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Sector sector; - private List vertices; - private int index; + private readonly Sector sector; + private readonly List vertices; + private readonly int index; #endregion @@ -44,17 +45,27 @@ namespace CodeImp.DoomBuilder.BuilderModes public ResultSectorUnclosed(Sector s, List v) { // Initialize - this.sector = s; - this.vertices = new List(v); - this.viewobjects.Add(s); + sector = s; + vertices = new List(v); + viewobjects.Add(s); + hidden = s.IgnoredErrorChecks.Contains(this.GetType()); //mxd foreach(Vertex vv in v) this.viewobjects.Add(vv); - this.description = "This sector is not a closed region and could cause problems with clipping and rendering in the game. The 'leaks' in the sector are indicated by the colored vertices."; - this.index = s.Index; + description = "This sector is not a closed region and could cause problems with clipping and rendering in the game. The 'leaks' in the sector are indicated by the colored vertices."; + index = s.Index; } #endregion #region ================== Methods + + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) sector.IgnoredErrorChecks.Add(t); + else if(sector.IgnoredErrorChecks.Contains(t)) sector.IgnoredErrorChecks.Remove(t); + } // This must return the string that is displayed in the listbox public override string ToString() diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultStrayVertex.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultStrayVertex.cs index d16a3a7e..d0723dac 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultStrayVertex.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultStrayVertex.cs @@ -1,41 +1,75 @@ -using CodeImp.DoomBuilder.Map; +#region ================== Namespaces + +using System; +using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; using System.Drawing; +#endregion + namespace CodeImp.DoomBuilder.BuilderModes.ErrorChecks { public class ResultStrayVertex : ErrorResult { + #region ================== Variables + + private readonly Vertex vertex; + + #endregion + + #region ================== Properties + public override int Buttons { get { return 1; } } public override string Button1Text { get { return "Delete Vertex"; } } - private Vertex vertex; + #endregion - // Constructor - public ResultStrayVertex(Vertex v) { + #region ================== Constructor / Destructor + + public ResultStrayVertex(Vertex v) + { // Initialize - this.vertex = v; - this.viewobjects.Add(v); - this.description = "This vertex is not connected to any linedef."; + vertex = v; + viewobjects.Add(v); + hidden = v.IgnoredErrorChecks.Contains(this.GetType()); //mxd + description = "This vertex is not connected to any linedef."; + } + + #endregion + + #region ================== Methods + + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) vertex.IgnoredErrorChecks.Add(t); + else if(vertex.IgnoredErrorChecks.Contains(t)) vertex.IgnoredErrorChecks.Remove(t); } // This must return the string that is displayed in the listbox - public override string ToString() { + public override string ToString() + { return "Vertex " + vertex.Index + " at " + vertex.Position.x + ", " + vertex.Position.y + " is not connected to any linedef."; } // Rendering - public override void RenderOverlaySelection(IRenderer2D renderer) { + public override void RenderOverlaySelection(IRenderer2D renderer) + { renderer.RenderRectangleFilled(new RectangleF(vertex.Position.x - 3, vertex.Position.y - 3, 6f, 6f), General.Colors.Selection, true); } // This removes the vertex - public override bool Button1Click(bool batchMode) { + public override bool Button1Click(bool batchMode) + { if(!batchMode) General.Map.UndoRedo.CreateUndo("Delete vertex"); vertex.Dispose(); General.Map.IsChanged = true; General.Map.ThingsFilter.Update(); return true; } + + #endregion } } diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultStuckThingInLine.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultStuckThingInLine.cs index b8f30414..9089409b 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultStuckThingInLine.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultStuckThingInLine.cs @@ -16,6 +16,7 @@ #region ================== Namespaces +using System; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; @@ -27,7 +28,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Thing thing; + private readonly Thing thing; #endregion @@ -44,14 +45,24 @@ namespace CodeImp.DoomBuilder.BuilderModes public ResultStuckThingInLine(Thing t) { // Initialize - this.thing = t; - this.viewobjects.Add(t); - this.description = "This thing is stuck in a wall (single-sided line) and will likely not be able to move around."; + thing = t; + viewobjects.Add(t); + hidden = t.IgnoredErrorChecks.Contains(this.GetType()); //mxd + description = "This thing is stuck in a wall (single-sided line) and will likely not be able to move around."; } #endregion #region ================== Methods + + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) thing.IgnoredErrorChecks.Add(t); + else if(thing.IgnoredErrorChecks.Contains(t)) thing.IgnoredErrorChecks.Remove(t); + } // This must return the string that is displayed in the listbox public override string ToString() diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultStuckThingInThing.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultStuckThingInThing.cs index 48e9d92a..fb694ad3 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultStuckThingInThing.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultStuckThingInThing.cs @@ -16,6 +16,7 @@ #region ================== Namespaces +using System; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; @@ -27,8 +28,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Thing thing1; - private Thing thing2; //mxd + private readonly Thing thing1; + private readonly Thing thing2; //mxd #endregion @@ -48,6 +49,7 @@ namespace CodeImp.DoomBuilder.BuilderModes this.thing1 = t1; this.thing2 = t2; //mxd this.viewobjects.Add(t1); + hidden = (t1.IgnoredErrorChecks.Contains(this.GetType()) && t2.IgnoredErrorChecks.Contains(this.GetType())); //mxd this.description = "This thing is stuck in another thing. Both will likely not be able to move around."; } @@ -55,6 +57,23 @@ namespace CodeImp.DoomBuilder.BuilderModes #region ================== Methods + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) + { + thing1.IgnoredErrorChecks.Add(t); + thing2.IgnoredErrorChecks.Add(t); + } + else + { + if(thing1.IgnoredErrorChecks.Contains(t)) thing1.IgnoredErrorChecks.Remove(t); + if(thing2.IgnoredErrorChecks.Contains(t)) thing2.IgnoredErrorChecks.Remove(t); + } + } + // This must return the string that is displayed in the listbox public override string ToString() { diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultThingOutside.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultThingOutside.cs index fc955d24..e2274969 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultThingOutside.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultThingOutside.cs @@ -16,6 +16,7 @@ #region ================== Namespaces +using System; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; @@ -27,7 +28,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Thing thing; + private readonly Thing thing; #endregion @@ -44,15 +45,25 @@ namespace CodeImp.DoomBuilder.BuilderModes public ResultThingOutside(Thing t) { // Initialize - this.thing = t; - this.viewobjects.Add(t); - this.description = "This thing is completely outside the map."; + thing = t; + viewobjects.Add(t); + hidden = t.IgnoredErrorChecks.Contains(this.GetType()); //mxd + description = "This thing is completely outside the map."; } #endregion #region ================== Methods + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) thing.IgnoredErrorChecks.Add(t); + else if(thing.IgnoredErrorChecks.Contains(t)) thing.IgnoredErrorChecks.Remove(t); + } + // This must return the string that is displayed in the listbox public override string ToString() { diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultUnknownFlat.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultUnknownFlat.cs index 5dd03a68..a52525a6 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultUnknownFlat.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultUnknownFlat.cs @@ -16,6 +16,7 @@ #region ================== Namespaces +using System; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; @@ -27,8 +28,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Sector sector; - private bool ceiling; + private readonly Sector sector; + private readonly bool ceiling; #endregion @@ -48,7 +49,7 @@ namespace CodeImp.DoomBuilder.BuilderModes this.sector = s; this.ceiling = ceiling; this.viewobjects.Add(s); - + this.hidden = s.IgnoredErrorChecks.Contains(this.GetType()); //mxd string objname = ceiling ? "ceiling" : "floor"; this.description = "This sector's " + objname + " uses an unknown flat. This could be the result of missing resources, or a mistyped flat name. Click the 'Add Default Flat' button to use a known flat instead."; } @@ -56,6 +57,15 @@ namespace CodeImp.DoomBuilder.BuilderModes #endregion #region ================== Methods + + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) sector.IgnoredErrorChecks.Add(t); + else if(sector.IgnoredErrorChecks.Contains(t)) sector.IgnoredErrorChecks.Remove(t); + } // This must return the string that is displayed in the listbox public override string ToString() diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultUnknownTexture.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultUnknownTexture.cs index 3c4d9b26..f1ae9e3f 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultUnknownTexture.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultUnknownTexture.cs @@ -16,6 +16,7 @@ #region ================== Namespaces +using System; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; @@ -27,8 +28,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Sidedef side; - private SidedefPart part; + private readonly Sidedef side; + private readonly SidedefPart part; #endregion @@ -49,12 +50,22 @@ namespace CodeImp.DoomBuilder.BuilderModes this.side = sd; this.part = part; this.viewobjects.Add(sd); + this.hidden = sd.IgnoredErrorChecks.Contains(this.GetType()); //mxd this.description = "This sidedef uses an unknown texture. This could be the result of missing resources, or a mistyped texture name. Click the 'Remove Texture' button to remove the texture or click on 'Add Default Texture' to use a known texture instead."; } #endregion #region ================== Methods + + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) side.IgnoredErrorChecks.Add(t); + else if(side.IgnoredErrorChecks.Contains(t)) side.IgnoredErrorChecks.Remove(t); + } // This must return the string that is displayed in the listbox public override string ToString() diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultUnknownThing.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultUnknownThing.cs index 0adfce00..19a1286b 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultUnknownThing.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultUnknownThing.cs @@ -1,38 +1,74 @@ -using CodeImp.DoomBuilder.Map; +#region ================== Namespaces + +using System; +using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; +#endregion + namespace CodeImp.DoomBuilder.BuilderModes.ErrorChecks { - public class ResultUnknownThing : ErrorResult { + public class ResultUnknownThing : ErrorResult + { + + #region ================== Variables + + private readonly Thing thing; + + #endregion + + #region ================== Properties + public override int Buttons { get { return 1; } } public override string Button1Text { get { return "Delete Thing"; } } - private Thing thing; + #endregion - // Constructor - public ResultUnknownThing(Thing t) { + #region ================== Constructor / Destructor + + public ResultUnknownThing(Thing t) + { // Initialize - this.thing = t; - this.viewobjects.Add(t); - this.description = "This thing has unknown type (eg. it's not defined in DECORATE or current game configuration)."; + thing = t; + viewobjects.Add(t); + hidden = t.IgnoredErrorChecks.Contains(this.GetType()); //mxd + description = "This thing has unknown type (eg. it's not defined in DECORATE or current game configuration)."; + } + + #endregion + + #region ================== Methods + + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) thing.IgnoredErrorChecks.Add(t); + else if(thing.IgnoredErrorChecks.Contains(t)) thing.IgnoredErrorChecks.Remove(t); } // This must return the string that is displayed in the listbox - public override string ToString() { + public override string ToString() + { return "Thing " + thing.Index + " at " + thing.Position.x + ", " + thing.Position.y + " has unknown type (" + thing.Type + ")."; } // Rendering - public override void RenderOverlaySelection(IRenderer2D renderer) { + public override void RenderOverlaySelection(IRenderer2D renderer) + { renderer.RenderThing(thing, renderer.DetermineThingColor(thing), 1.0f); } // This removes the thing - public override bool Button1Click(bool batchMode) { + public override bool Button1Click(bool batchMode) + { if(!batchMode) General.Map.UndoRedo.CreateUndo("Delete thing"); thing.Dispose(); General.Map.IsChanged = true; General.Map.ThingsFilter.Update(); return true; } + + #endregion } } diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultUnusedTexture.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultUnusedTexture.cs index 9a622d16..412f2cb0 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultUnusedTexture.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultUnusedTexture.cs @@ -1,5 +1,6 @@ #region ================== Namespaces +using System; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; using CodeImp.DoomBuilder.GZBuilder.Tools; @@ -12,8 +13,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Sidedef side; - private SidedefPart part; + private readonly Sidedef side; + private readonly SidedefPart part; #endregion @@ -33,12 +34,22 @@ namespace CodeImp.DoomBuilder.BuilderModes this.side = sd; this.part = part; this.viewobjects.Add(sd); + this.hidden = sd.IgnoredErrorChecks.Contains(this.GetType()); //mxd this.description = "This sidedef uses an upper or lower texture, which is not required (it will never be visible ingame). Click the Remove Texture button to remove the texture (this will also reset texture offsets and scale in UDMF map format)."; } #endregion #region ================== Methods + + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) side.IgnoredErrorChecks.Add(t); + else if(side.IgnoredErrorChecks.Contains(t)) side.IgnoredErrorChecks.Remove(t); + } // This must return the string that is displayed in the listbox public override string ToString() diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultVertexOverlappingLine.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultVertexOverlappingLine.cs index cab6002e..a0ae3fdd 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultVertexOverlappingLine.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultVertexOverlappingLine.cs @@ -1,5 +1,6 @@ #region ================== Namespaces +using System; using System.Collections.Generic; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; @@ -12,8 +13,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Linedef line; - private Vertex vertex; + private readonly Linedef line; + private readonly Vertex vertex; #endregion @@ -30,24 +31,44 @@ namespace CodeImp.DoomBuilder.BuilderModes public ResultVertexOverlappingLine(Vertex v, Linedef l) { // Initialize - this.line = l; - this.vertex = v; - this.viewobjects.Add(l); - this.viewobjects.Add(v); - this.description = "This vertex overlaps this linedef without splitting it."; + line = l; + vertex = v; + viewobjects.Add(l); + viewobjects.Add(v); + hidden = (l.IgnoredErrorChecks.Contains(this.GetType()) && v.IgnoredErrorChecks.Contains(this.GetType())); //mxd + description = "This vertex overlaps this linedef without splitting it."; } #endregion #region ================== Methods + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) + { + vertex.IgnoredErrorChecks.Add(t); + line.IgnoredErrorChecks.Add(t); + } + else + { + if(vertex.IgnoredErrorChecks.Contains(t)) vertex.IgnoredErrorChecks.Remove(t); + if(line.IgnoredErrorChecks.Contains(t)) line.IgnoredErrorChecks.Remove(t); + } + } + // This must return the string that is displayed in the listbox - public override string ToString() { + public override string ToString() + { return "Vertex " + vertex.Index + " overlaps line " + line.Index + " without splitting it"; } // Rendering - public override void PlotSelection(IRenderer2D renderer) { + public override void PlotSelection(IRenderer2D renderer) + { renderer.PlotLinedef(line, General.Colors.Selection); renderer.PlotVertex(line.Start, ColorCollection.VERTICES); renderer.PlotVertex(line.End, ColorCollection.VERTICES); @@ -56,7 +77,8 @@ namespace CodeImp.DoomBuilder.BuilderModes } // Fix by splitting the line - public override bool Button1Click(bool batchMode) { + public override bool Button1Click(bool batchMode) + { if(!batchMode) General.Map.UndoRedo.CreateUndo("Split Linedef"); line.Split(vertex); diff --git a/Source/Plugins/BuilderModes/ErrorChecks/ResultVertexOverlappingVertex.cs b/Source/Plugins/BuilderModes/ErrorChecks/ResultVertexOverlappingVertex.cs index e71f2521..114f56ef 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/ResultVertexOverlappingVertex.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/ResultVertexOverlappingVertex.cs @@ -1,5 +1,6 @@ #region ================== Namespaces +using System; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; @@ -11,8 +12,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { #region ================== Variables - private Vertex vertex1; - private Vertex vertex2; + private readonly Vertex vertex1; + private readonly Vertex vertex2; #endregion @@ -29,29 +30,50 @@ namespace CodeImp.DoomBuilder.BuilderModes public ResultVertexOverlappingVertex(Vertex v1, Vertex v2) { // Initialize - this.vertex1 = v1; - this.vertex2 = v2; - this.viewobjects.Add(v1); - this.viewobjects.Add(v2); - this.description = "These vertices have the same position."; + vertex1 = v1; + vertex2 = v2; + viewobjects.Add(v1); + viewobjects.Add(v2); + hidden = (v1.IgnoredErrorChecks.Contains(this.GetType()) && v2.IgnoredErrorChecks.Contains(this.GetType())); //mxd + description = "These vertices have the same position."; } #endregion #region ================== Methods + // This sets if this result is displayed in ErrorCheckForm (mxd) + internal override void Hide(bool hide) + { + hidden = hide; + Type t = this.GetType(); + if(hide) + { + vertex1.IgnoredErrorChecks.Add(t); + vertex2.IgnoredErrorChecks.Add(t); + } + else + { + if(vertex1.IgnoredErrorChecks.Contains(t)) vertex1.IgnoredErrorChecks.Remove(t); + if(vertex2.IgnoredErrorChecks.Contains(t)) vertex2.IgnoredErrorChecks.Remove(t); + } + } + // This must return the string that is displayed in the listbox - public override string ToString() { + public override string ToString() + { return "Vertices " + vertex1.Index + " and " + vertex2.Index + " have the same position"; } // Rendering - public override void PlotSelection(IRenderer2D renderer) { + public override void PlotSelection(IRenderer2D renderer) + { renderer.PlotVertex(vertex1, ColorCollection.SELECTION); } // Fix by splitting the line - public override bool Button1Click(bool batchMode) { + public override bool Button1Click(bool batchMode) + { if(!batchMode) General.Map.UndoRedo.CreateUndo("Merge vertices"); vertex2.Join(vertex1); General.Map.Map.Update(); diff --git a/Source/Plugins/BuilderModes/Interface/ErrorCheckForm.Designer.cs b/Source/Plugins/BuilderModes/Interface/ErrorCheckForm.Designer.cs index 9e140c51..fef9c33c 100644 --- a/Source/Plugins/BuilderModes/Interface/ErrorCheckForm.Designer.cs +++ b/Source/Plugins/BuilderModes/Interface/ErrorCheckForm.Designer.cs @@ -35,6 +35,7 @@ namespace CodeImp.DoomBuilder.BuilderModes this.resultcontextmenustrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.resultshowall = new System.Windows.Forms.ToolStripMenuItem(); this.resulthidecurrent = new System.Windows.Forms.ToolStripMenuItem(); + this.resulthidecurrenttype = new System.Windows.Forms.ToolStripMenuItem(); this.resultshowonlycurrent = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.resultcopytoclipboard = new System.Windows.Forms.ToolStripMenuItem(); @@ -107,11 +108,12 @@ namespace CodeImp.DoomBuilder.BuilderModes this.resultcontextmenustrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.resultshowall, this.resulthidecurrent, + this.resulthidecurrenttype, this.resultshowonlycurrent, this.toolStripSeparator1, this.resultcopytoclipboard}); this.resultcontextmenustrip.Name = "resultcontextmenustrip"; - this.resultcontextmenustrip.Size = new System.Drawing.Size(232, 120); + this.resultcontextmenustrip.Size = new System.Drawing.Size(232, 142); this.resultcontextmenustrip.Opening += new System.ComponentModel.CancelEventHandler(this.resultcontextmenustrip_Opening); // // resultshowall @@ -119,7 +121,7 @@ namespace CodeImp.DoomBuilder.BuilderModes this.resultshowall.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Show; this.resultshowall.Name = "resultshowall"; this.resultshowall.Size = new System.Drawing.Size(231, 22); - this.resultshowall.Text = "Show All Results"; + this.resultshowall.Text = "Show all results"; this.resultshowall.Click += new System.EventHandler(this.resultshowall_Click); // // resulthidecurrent @@ -127,9 +129,17 @@ namespace CodeImp.DoomBuilder.BuilderModes this.resulthidecurrent.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Hide; this.resulthidecurrent.Name = "resulthidecurrent"; this.resulthidecurrent.Size = new System.Drawing.Size(231, 22); - this.resulthidecurrent.Text = "Hide results of this type"; + this.resulthidecurrent.Text = "Hide result"; this.resulthidecurrent.Click += new System.EventHandler(this.resulthidecurrent_Click); // + // resulthidecurrenttype + // + this.resulthidecurrenttype.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.HideAll; + this.resulthidecurrenttype.Name = "resulthidecurrenttype"; + this.resulthidecurrenttype.Size = new System.Drawing.Size(231, 22); + this.resulthidecurrenttype.Text = "Hide results of this type"; + this.resulthidecurrenttype.Click += new System.EventHandler(this.resulthidecurrenttype_Click); + // // resultshowonlycurrent // this.resultshowonlycurrent.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Show2; @@ -255,22 +265,22 @@ namespace CodeImp.DoomBuilder.BuilderModes this.exporttofile, this.copytoclipboard}); this.exporttrsultsmenustrip.Name = "exporttrsultsmenustrip"; - this.exporttrsultsmenustrip.Size = new System.Drawing.Size(172, 48); + this.exporttrsultsmenustrip.Size = new System.Drawing.Size(207, 48); // // exporttofile // this.exporttofile.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Save; this.exporttofile.Name = "exporttofile"; - this.exporttofile.Size = new System.Drawing.Size(171, 22); - this.exporttofile.Text = "Export to File"; + this.exporttofile.Size = new System.Drawing.Size(206, 22); + this.exporttofile.Text = "Export results to file"; this.exporttofile.Click += new System.EventHandler(this.exporttofile_Click); // // copytoclipboard // this.copytoclipboard.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Copy; this.copytoclipboard.Name = "copytoclipboard"; - this.copytoclipboard.Size = new System.Drawing.Size(171, 22); - this.copytoclipboard.Text = "Copy to Clipboard"; + this.copytoclipboard.Size = new System.Drawing.Size(206, 22); + this.copytoclipboard.Text = "Copy results to clipboard"; this.copytoclipboard.Click += new System.EventHandler(this.copytoclipboard_Click); // // saveFileDialog @@ -288,7 +298,7 @@ namespace CodeImp.DoomBuilder.BuilderModes this.exportresults.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.exportresults.Location = new System.Drawing.Point(10, 89); this.exportresults.Name = "exportresults"; - this.exportresults.Size = new System.Drawing.Size(140, 25); + this.exportresults.Size = new System.Drawing.Size(160, 25); this.exportresults.SplitMenuStrip = this.exporttrsultsmenustrip; this.exportresults.TabIndex = 0; this.exportresults.Text = "Export to File"; @@ -347,9 +357,10 @@ namespace CodeImp.DoomBuilder.BuilderModes private System.Windows.Forms.SaveFileDialog saveFileDialog; private System.Windows.Forms.ContextMenuStrip resultcontextmenustrip; private System.Windows.Forms.ToolStripMenuItem resultshowall; - private System.Windows.Forms.ToolStripMenuItem resulthidecurrent; + private System.Windows.Forms.ToolStripMenuItem resulthidecurrenttype; private System.Windows.Forms.ToolStripMenuItem resultshowonlycurrent; private System.Windows.Forms.ToolStripMenuItem resultcopytoclipboard; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem resulthidecurrent; } } \ No newline at end of file diff --git a/Source/Plugins/BuilderModes/Interface/ErrorCheckForm.cs b/Source/Plugins/BuilderModes/Interface/ErrorCheckForm.cs index 78df3220..d5115ca9 100644 --- a/Source/Plugins/BuilderModes/Interface/ErrorCheckForm.cs +++ b/Source/Plugins/BuilderModes/Interface/ErrorCheckForm.cs @@ -137,7 +137,7 @@ namespace CodeImp.DoomBuilder.BuilderModes } else { - if (!hiddentresulttypes.Contains(result.GetType())) //mxd + if (!result.IsHidden && !hiddentresulttypes.Contains(result.GetType())) //mxd { results.Items.Add(result); } @@ -596,7 +596,7 @@ namespace CodeImp.DoomBuilder.BuilderModes #endregion - #region =================== Results Context Menu (mxd) + #region ================== Results Context Menu (mxd) private void resultcontextmenustrip_Opening(object sender, System.ComponentModel.CancelEventArgs e) { @@ -605,11 +605,15 @@ namespace CodeImp.DoomBuilder.BuilderModes resultshowall.Enabled = (resultslist.Count > 0 && resultslist.Count > results.Items.Count); resultcopytoclipboard.Enabled = haveresult; resulthidecurrent.Enabled = haveresult; + resulthidecurrenttype.Enabled = haveresult; resultshowonlycurrent.Enabled = haveresult; } private void resultshowall_Click(object sender, EventArgs e) { + // Reset ignored items + foreach(ErrorResult result in resultslist) result.Hide(false); + // Restore items results.Items.Clear(); results.Items.AddRange(resultslist.ToArray()); @@ -619,7 +623,18 @@ namespace CodeImp.DoomBuilder.BuilderModes UpdateTitle(); } - private void resulthidecurrent_Click(object sender, EventArgs e) + private void resulthidecurrent_Click(object sender, EventArgs e) + { + ErrorResult r = results.SelectedItem as ErrorResult; + if(r == null) return; + r.Hide(true); + results.Items.Remove(r); + + // Do the obvious + UpdateTitle(); + } + + private void resulthidecurrenttype_Click(object sender, EventArgs e) { ErrorResult r = results.SelectedItem as ErrorResult; if(r == null) return; diff --git a/Source/Plugins/BuilderModes/Properties/Resources.Designer.cs b/Source/Plugins/BuilderModes/Properties/Resources.Designer.cs index 63bf0243..380d0de3 100644 --- a/Source/Plugins/BuilderModes/Properties/Resources.Designer.cs +++ b/Source/Plugins/BuilderModes/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.5420 +// Runtime Version:2.0.50727.5466 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -214,6 +214,13 @@ namespace CodeImp.DoomBuilder.BuilderModes.Properties { } } + internal static System.Drawing.Bitmap HideAll { + get { + object obj = ResourceManager.GetObject("HideAll", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap List { get { object obj = ResourceManager.GetObject("List", resourceCulture); diff --git a/Source/Plugins/BuilderModes/Properties/Resources.resx b/Source/Plugins/BuilderModes/Properties/Resources.resx index 9bd6fdcd..8858db95 100644 --- a/Source/Plugins/BuilderModes/Properties/Resources.resx +++ b/Source/Plugins/BuilderModes/Properties/Resources.resx @@ -142,6 +142,9 @@ ..\Resources\SnapVerts.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Similar.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\DrawGridMode.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -160,8 +163,8 @@ ..\Resources\treeview.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Similar.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\FlipSelectionV.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\FloorsGradient.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -193,9 +196,6 @@ ..\Resources\BrightnessGradient.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\FlipSelectionV.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\Door.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -217,6 +217,9 @@ ..\Resources\DrawCurveMode.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Show2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\ColorPick.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -238,7 +241,7 @@ ..\Resources\FilterThings.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Show2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\HideAll.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/Source/Plugins/BuilderModes/Resources/HideAll.png b/Source/Plugins/BuilderModes/Resources/HideAll.png new file mode 100644 index 0000000000000000000000000000000000000000..d31b449052bf5e5052b654bbb7d3fe54bdb87e64 GIT binary patch literal 1678 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+n3Xa^B1$5BeXNr6bM+EIYV;~{3xK*A7;Nk-3KEmEQ%e+* zQqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxSU1_g&``n5OwZ87 z)XdCKN5ROz&`93^h|F{iO{`4Ktc=VRpg;*|TTx1yRgjAt)Gi>;Rw<*Tq`*pFzr4I$ zuiRKKzbIYb(9+TpWQLKEE>MMTab;dfVufyAu`f(~1RD^r68eAMwS&*t9 zlvv ztM~P_^2{qPNz6-5^>ndS0-B(gnVDi`Y3bv4~Pj*wm=R%;iu*SQ+p9GSucNdgcq1wm^@t^Ln>}9 z35xa*36!uiE>0^;FAEDVyL%)%&~s<&mMQ$IEv_e;e(E`jxRi*pa8Ez=!E-5h?7deD zmsg$aaMB2voD=M={kd&w+P$*!ve?+WGwhQs(=O#XtVN|9}3wEK@Si zzx0Fq^`)ew?pRvxyc#yo-od!XS0tG)P~`cchaX~$R&J5xm6zD^GSqIPm1FJS()7%i zjn8*hR{r*EVwj}Tm|(!6G_m8^clLx=Yciv{W*Iy%Ehx`zS{=S#w8CbdzKCnumy+*) zKK-njW}COYxoN@$6PAe=51%Qr*tJ99)TTWrKL3$j++%vd<;vB{pL?sn_a?6C*45R0 z)u%MQ>P0~0#S3amp_KLJgkm;d=9)GkQPC zl*kcgNldp9JD=?HtY?eK?85>Eu1cR{67twsq!z2L%-pnhTRX=}`Lhl0q68~Gt(g7i z=Ep-imZ|L53dKBMM>(L*47@wY-;bf?z#J>tcNGOuBjgHDmbU7C)m&3w8Z_m zsjB6Q#4GEQFKpkk$7I*Ug}c_h%3f&5CUVc^-5ML#J8POZ8ZYWh)+kG~S#wVWSs1SuvFLubxx4uI{(ip5 z0@XE95A7zumtVW$#S^xu>58X|9Q;l&G~4gz=N96d;Q#To!orlpC7;fGE9$-W)!#ex r^V0(!EgP5h>TG5YG=F$xKdS`8+4{VHTz8JMgK7v*S3j3^P6