diff --git a/Source/Core/Actions/ActionManager.cs b/Source/Core/Actions/ActionManager.cs index c227681e..a3a49c35 100644 --- a/Source/Core/Actions/ActionManager.cs +++ b/Source/Core/Actions/ActionManager.cs @@ -193,7 +193,7 @@ namespace CodeImp.DoomBuilder.Actions else { // Action already exists! - General.ErrorLogger.Add(ErrorType.Warning, "Action '" + name + "' already exists. Action names must be unique."); + General.ErrorLogger.Add(ErrorType.Warning, "Action \"" + name + "\" already exists. Action names must be unique."); } } diff --git a/Source/Core/Actions/HintsManager.cs b/Source/Core/Actions/HintsManager.cs index 71dd218b..0b4ce4ce 100644 --- a/Source/Core/Actions/HintsManager.cs +++ b/Source/Core/Actions/HintsManager.cs @@ -142,7 +142,7 @@ namespace CodeImp.DoomBuilder.Actions { General.Interface.ShowHints(DEFAULT_HINT); #if DEBUG - Console.WriteLine("WARNING: Unable to get hints for class '" + fullname + "', group '" + groupname + "'"); + Console.WriteLine("WARNING: Unable to get hints for class \"" + fullname + "\", group \"" + groupname + "\""); #endif return; } diff --git a/Source/Core/Compilers/Compiler.cs b/Source/Core/Compilers/Compiler.cs index 2dc37fc6..68c88a4b 100644 --- a/Source/Core/Compilers/Compiler.cs +++ b/Source/Core/Compilers/Compiler.cs @@ -76,9 +76,9 @@ namespace CodeImp.DoomBuilder.Compilers // Initialize this.info = info; this.errors = new List(); - this.includes = new HashSet(); //mxd - - General.WriteLogLine("Creating compiler '" + info.Name + "' on interface '" + this.GetType().Name + "'..."); + this.includes = new HashSet(StringComparer.OrdinalIgnoreCase); //mxd + + General.WriteLogLine("Creating compiler \"" + info.Name + "\" on interface \"" + this.GetType().Name + "\"..."); // Create temporary directory tempdir = Directory.CreateDirectory(General.MakeTempDirname()); @@ -146,7 +146,7 @@ namespace CodeImp.DoomBuilder.Compilers string srcfile = Path.Combine(info.Path, f); if(!File.Exists(srcfile)) { - General.ErrorLogger.Add(ErrorType.Error, "The file '" + f + "' required by the '" + info.Name + "' compiler is missing. According to the compiler configuration in '" + info.FileName + "', the was expected to be found in the following path: " + info.Path); + General.ErrorLogger.Add(ErrorType.Error, "The file \"" + f + "\" required by the \"" + info.Name + "\" compiler is missing. According to the compiler configuration in \"" + info.FileName + "\", it was expected to be found here: \"" + info.Path + "\""); } else { diff --git a/Source/Core/Config/ArgumentInfo.cs b/Source/Core/Config/ArgumentInfo.cs index 6d6521fc..add5e4bb 100644 --- a/Source/Core/Config/ArgumentInfo.cs +++ b/Source/Core/Config/ArgumentInfo.cs @@ -87,7 +87,7 @@ namespace CodeImp.DoomBuilder.Config } else { - General.ErrorLogger.Add(ErrorType.Warning, "'" + argspath + ".arg" + istr + "' references unknown enumeration '" + argdic["enum"] + "'."); + General.ErrorLogger.Add(ErrorType.Warning, "\"" + argspath + ".arg" + istr + "\" references unknown enumeration \"" + argdic["enum"] + "\"."); } } } diff --git a/Source/Core/Config/CompilerInfo.cs b/Source/Core/Config/CompilerInfo.cs index 9cba5741..fc868315 100644 --- a/Source/Core/Config/CompilerInfo.cs +++ b/Source/Core/Config/CompilerInfo.cs @@ -59,7 +59,7 @@ namespace CodeImp.DoomBuilder.Config // Constructor internal CompilerInfo(string filename, string name, string path, Configuration cfg) { - General.WriteLogLine("Registered compiler configuration '" + name + "' from '" + filename + "'"); + General.WriteLogLine("Registered compiler configuration \"" + name + "\" from \"" + filename + "\""); // Initialize this.filename = filename; @@ -80,7 +80,7 @@ namespace CodeImp.DoomBuilder.Config //mxd string include = de.Value.ToString().Replace(System.IO.Path.AltDirectorySeparatorChar, System.IO.Path.DirectorySeparatorChar); if(files.Contains(include)) - General.ErrorLogger.Add(ErrorType.Warning, "Include file '" + de.Value + "' is double-defined in '" + name + "' compiler configuration"); + General.ErrorLogger.Add(ErrorType.Warning, "Include file \"" + de.Value + "\" is double defined in \"" + name + "\" compiler configuration"); else files.Add(include); } diff --git a/Source/Core/Config/GeneralizedOption.cs b/Source/Core/Config/GeneralizedOption.cs index c098ed75..a2229535 100644 --- a/Source/Core/Config/GeneralizedOption.cs +++ b/Source/Core/Config/GeneralizedOption.cs @@ -76,7 +76,7 @@ namespace CodeImp.DoomBuilder.Config } else { - General.ErrorLogger.Add(ErrorType.Warning, "Structure '" + fullpath + "." + name + "' contains invalid entries. The keys must be numeric."); + General.ErrorLogger.Add(ErrorType.Warning, "Structure \"" + fullpath + "." + name + "\" contains invalid entries. The keys must be numeric."); } } diff --git a/Source/Core/Config/MapLumpInfo.cs b/Source/Core/Config/MapLumpInfo.cs index 158ee959..76e168b9 100644 --- a/Source/Core/Config/MapLumpInfo.cs +++ b/Source/Core/Config/MapLumpInfo.cs @@ -55,7 +55,7 @@ namespace CodeImp.DoomBuilder.Config } else { - General.ErrorLogger.Add(ErrorType.Warning, "Map lump '" + name + "' in the current game configuration specifies an unknown script configuration '" + scriptconfig + "'. Using plain text instead."); + General.ErrorLogger.Add(ErrorType.Warning, "Map lump \"" + name + "\" in the current game configuration specifies an unknown script configuration \"" + scriptconfig + "\". Using plain text instead."); this.Script = new ScriptConfiguration(); } } diff --git a/Source/Core/Config/NodebuilderInfo.cs b/Source/Core/Config/NodebuilderInfo.cs index ea6dc749..68de5bbc 100644 --- a/Source/Core/Config/NodebuilderInfo.cs +++ b/Source/Core/Config/NodebuilderInfo.cs @@ -55,7 +55,7 @@ namespace CodeImp.DoomBuilder.Config // Constructor public NodebuilderInfo(string filename, string name, Configuration cfg) { - General.WriteLogLine("Registered nodebuilder configuration '" + name + "' from '" + filename + "'"); + General.WriteLogLine("Registered nodebuilder configuration \"" + name + "\" from \"" + filename + "\""); // Initialize this.name = name; @@ -80,7 +80,7 @@ namespace CodeImp.DoomBuilder.Config } // No compiler found? - if(this.compiler == null) throw new Exception("No such compiler defined: '" + compilername + "'"); + if(this.compiler == null) throw new Exception("Compiler \"" + compilername + "\" is not defined"); } // Constructor for "none" nodebuilder diff --git a/Source/Core/Config/ProgramConfiguration.cs b/Source/Core/Config/ProgramConfiguration.cs index 1b67bddf..f7f8cf88 100644 --- a/Source/Core/Config/ProgramConfiguration.cs +++ b/Source/Core/Config/ProgramConfiguration.cs @@ -464,7 +464,7 @@ namespace CodeImp.DoomBuilder.Config cfg.WriteSetting("defaultbrightness", defaultbrightness); // Save settings configuration - General.WriteLogLine("Saving program configuration to '" + filepathname + "'..."); + General.WriteLogLine("Saving program configuration to \"" + filepathname + "\"..."); cfg.SaveConfiguration(filepathname); } diff --git a/Source/Core/Config/ScriptConfiguration.cs b/Source/Core/Config/ScriptConfiguration.cs index 02d8293c..692d0383 100644 --- a/Source/Core/Config/ScriptConfiguration.cs +++ b/Source/Core/Config/ScriptConfiguration.cs @@ -28,12 +28,20 @@ using ScintillaNET; namespace CodeImp.DoomBuilder.Config { //mxd - internal enum ScriptType + public enum ScriptType { UNKNOWN = 0, ACS = 1, MODELDEF = 2, DECORATE = 3, + GLDEFS = 4, + SNDSEQ = 5, + MAPINFO = 6, + VOXELDEF = 7, + TEXTURES = 8, + ANIMDEFS = 9, + REVERBS = 10, + TERRAIN = 11, } internal class ScriptConfiguration : IComparable @@ -215,7 +223,7 @@ namespace CodeImp.DoomBuilder.Config string keyword = de.Key.ToString(); if(keywords.ContainsKey(keyword)) //mxd { - General.ErrorLogger.Add(ErrorType.Warning, "Keyword \"" + keyword + "\" is double-defined in \"" + description + "\" script configuration."); + General.ErrorLogger.Add(ErrorType.Warning, "Keyword \"" + keyword + "\" is double defined in \"" + description + "\" script configuration."); continue; } @@ -234,7 +242,7 @@ namespace CodeImp.DoomBuilder.Config string property = de.Key.ToString(); if(lowerproperties.ContainsValue(property)) //mxd { - General.ErrorLogger.Add(ErrorType.Warning, "Property \"" + property + "\" is double-defined in \"" + description + "\" script configuration."); + General.ErrorLogger.Add(ErrorType.Warning, "Property \"" + property + "\" is double defined in \"" + description + "\" script configuration."); continue; } @@ -252,7 +260,7 @@ namespace CodeImp.DoomBuilder.Config string constant = de.Key.ToString(); if(lowerconstants.ContainsValue(constant)) //mxd { - General.ErrorLogger.Add(ErrorType.Warning, "Constant \"" + constant + "\" is double-defined in \"" + description + "\" script configuration."); + General.ErrorLogger.Add(ErrorType.Warning, "Constant \"" + constant + "\" is double defined in \"" + description + "\" script configuration."); continue; } @@ -278,7 +286,7 @@ namespace CodeImp.DoomBuilder.Config string name = Path.GetFileNameWithoutExtension(file); if(string.IsNullOrEmpty(name)) { - General.ErrorLogger.Add(ErrorType.Warning, "Failed to load snippet '" + file + "' for '" + description + "' script configuration."); + General.ErrorLogger.Add(ErrorType.Warning, "Failed to load snippet \"" + file + "\" for \"" + description + "\" script configuration."); } else { @@ -291,7 +299,7 @@ namespace CodeImp.DoomBuilder.Config } else { - General.ErrorLogger.Add(ErrorType.Warning, "Failed to load snippet '" + file + "' for '" + description + "' script configuration: file is empty!"); + General.ErrorLogger.Add(ErrorType.Warning, "Failed to load snippet \"" + file + "\" for \"" + description + "\" script configuration: file is empty!"); } } } @@ -318,7 +326,7 @@ namespace CodeImp.DoomBuilder.Config } // No compiler found? - if(this.compiler == null) throw new Exception("No such compiler defined: '" + compilername + "'"); + if(this.compiler == null) throw new Exception("Compiler \"" + compilername + "\" is not defined"); } } diff --git a/Source/Core/Config/ThingCategory.cs b/Source/Core/Config/ThingCategory.cs index c6c20c96..a2a08555 100644 --- a/Source/Core/Config/ThingCategory.cs +++ b/Source/Core/Config/ThingCategory.cs @@ -246,7 +246,7 @@ namespace CodeImp.DoomBuilder.Config if(child.IsValid && child.things.Count > 0) { if(cats.ContainsKey(child.title.ToLowerInvariant())) - General.ErrorLogger.Add(ErrorType.Warning, "Thing Category '" + child.title + "' is double-defined in " + this.title); + General.ErrorLogger.Add(ErrorType.Warning, "Thing Category \"" + child.title + "\" is double defined in " + this.title); cats[child.title.ToLowerInvariant()] = child; } } diff --git a/Source/Core/Config/ThingsFlagsCompare.cs b/Source/Core/Config/ThingsFlagsCompare.cs index c89ba714..84c3f074 100644 --- a/Source/Core/Config/ThingsFlagsCompare.cs +++ b/Source/Core/Config/ThingsFlagsCompare.cs @@ -47,7 +47,7 @@ namespace CodeImp.DoomBuilder.Config // Duplicate flags check if(Flags.ContainsKey(flag)) - General.ErrorLogger.Add(ErrorType.Warning, "ThingFlagsCompare flag '" + flag + "' is double-defined in '" + name + "' group"); + General.ErrorLogger.Add(ErrorType.Warning, "ThingFlagsCompare flag \"" + flag + "\" is double defined in the \"" + name + "\" group"); Flags[flag] = new ThingFlagsCompare(cfg, name, flag); } @@ -294,7 +294,7 @@ namespace CodeImp.DoomBuilder.Config result.Add("Thing is not used by any class."); break; default: - result.Add("At least one '" + group.Key + "' flag should be set."); + result.Add("At least one \"" + group.Key + "\" flag should be set."); break; } } diff --git a/Source/Core/Data/ColormapImage.cs b/Source/Core/Data/ColormapImage.cs index c51d30b9..1790a1a4 100644 --- a/Source/Core/Data/ColormapImage.cs +++ b/Source/Core/Data/ColormapImage.cs @@ -67,7 +67,7 @@ namespace CodeImp.DoomBuilder.Data if(reader is UnknownImageReader) { // Data is in an unknown format! - General.ErrorLogger.Add(ErrorType.Error, "Colormap lump '" + Name + "' data format could not be read. Does this lump contain valid colormap data at all?"); + General.ErrorLogger.Add(ErrorType.Error, "Colormap lump \"" + Name + "\" data format could not be read. Does this lump contain valid colormap data at all?"); bitmap = null; } else @@ -97,7 +97,7 @@ namespace CodeImp.DoomBuilder.Data else { // Missing a patch lump! - General.ErrorLogger.Add(ErrorType.Error, "Missing colormap lump '" + Name + "'. Did you forget to include required resources?"); + General.ErrorLogger.Add(ErrorType.Error, "Missing colormap lump \"" + Name + "\". Did you forget to include required resources?"); loadfailed = true; } diff --git a/Source/Core/Data/DataLocation.cs b/Source/Core/Data/DataLocation.cs index a028d0ed..bbcddc2d 100644 --- a/Source/Core/Data/DataLocation.cs +++ b/Source/Core/Data/DataLocation.cs @@ -79,7 +79,7 @@ namespace CodeImp.DoomBuilder.Data } } - return name; + return (name ?? string.Empty); } // This compares two locations diff --git a/Source/Core/Data/FileImage.cs b/Source/Core/Data/FileImage.cs index ed715341..0a59baa4 100644 --- a/Source/Core/Data/FileImage.cs +++ b/Source/Core/Data/FileImage.cs @@ -172,7 +172,7 @@ namespace CodeImp.DoomBuilder.Data // Not loaded? if(bitmap == null) { - General.ErrorLogger.Add(ErrorType.Error, "Image file '" + filepathname + "' data format could not be read, while loading image '" + this.Name + "'. Is this a valid picture file at all?"); + General.ErrorLogger.Add(ErrorType.Error, "Image file \"" + filepathname + "\" data format could not be read, while loading image \"" + this.Name + "\". Is this a valid picture file at all?"); loadfailed = true; } else diff --git a/Source/Core/Data/FlatImage.cs b/Source/Core/Data/FlatImage.cs index e3e5031d..46bf27a0 100644 --- a/Source/Core/Data/FlatImage.cs +++ b/Source/Core/Data/FlatImage.cs @@ -68,7 +68,7 @@ namespace CodeImp.DoomBuilder.Data if(reader is UnknownImageReader) { // Data is in an unknown format! - General.ErrorLogger.Add(ErrorType.Error, "Flat lump '" + Name + "' data format could not be read. Does this lump contain valid picture data at all?"); + General.ErrorLogger.Add(ErrorType.Error, "Flat lump \"" + Name + "\" data format could not be read. Does this lump contain valid picture data at all?"); bitmap = null; } else @@ -98,7 +98,7 @@ namespace CodeImp.DoomBuilder.Data else { // Missing a patch lump! - General.ErrorLogger.Add(ErrorType.Error, "Missing flat lump '" + Name + "'. Did you forget to include required resources?"); + General.ErrorLogger.Add(ErrorType.Error, "Missing flat lump \"" + Name + "\". Did you forget to include required resources?"); loadfailed = true; } diff --git a/Source/Core/Data/HighResImage.cs b/Source/Core/Data/HighResImage.cs index 4d7c65fd..9ec9da1d 100644 --- a/Source/Core/Data/HighResImage.cs +++ b/Source/Core/Data/HighResImage.cs @@ -252,12 +252,9 @@ namespace CodeImp.DoomBuilder.Data if(p.flipx || p.flipy) { RotateFlipType flip; - if(p.flipx && !p.flipy) - flip = RotateFlipType.RotateNoneFlipX; - else if(!p.flipx && p.flipy) - flip = RotateFlipType.RotateNoneFlipY; - else - flip = RotateFlipType.RotateNoneFlipXY; + if(p.flipx && !p.flipy) flip = RotateFlipType.RotateNoneFlipX; + else if(!p.flipx && p.flipy) flip = RotateFlipType.RotateNoneFlipY; + else flip = RotateFlipType.RotateNoneFlipXY; patchbmp.RotateFlip(flip); } @@ -267,15 +264,9 @@ namespace CodeImp.DoomBuilder.Data RotateFlipType rotate; switch(p.rotate) { - case 90: - rotate = RotateFlipType.Rotate90FlipNone; - break; - case 180: - rotate = RotateFlipType.Rotate180FlipNone; - break; - default: - rotate = RotateFlipType.Rotate270FlipNone; - break; + case 90: rotate = RotateFlipType.Rotate90FlipNone; break; + case 180: rotate = RotateFlipType.Rotate180FlipNone; break; + default: rotate = RotateFlipType.Rotate270FlipNone; break; } patchbmp.RotateFlip(rotate); } diff --git a/Source/Core/Data/ImageData.cs b/Source/Core/Data/ImageData.cs index d3609e5b..365ac8ae 100644 --- a/Source/Core/Data/ImageData.cs +++ b/Source/Core/Data/ImageData.cs @@ -277,7 +277,7 @@ namespace CodeImp.DoomBuilder.Data catch(Exception e) { bitmap = oldbitmap; - General.ErrorLogger.Add(ErrorType.Warning, "Cannot lock image '" + name + "' for pixel format conversion. The image may not be displayed correctly.\n" + e.GetType().Name + ": " + e.Message); + General.ErrorLogger.Add(ErrorType.Warning, "Cannot lock image \"" + name + "\" for pixel format conversion. The image may not be displayed correctly.\n" + e.GetType().Name + ": " + e.Message); } } @@ -293,7 +293,7 @@ namespace CodeImp.DoomBuilder.Data } catch(Exception e) { - General.ErrorLogger.Add(ErrorType.Warning, "Cannot lock image '" + name + "' for color correction. The image may not be displayed correctly.\n" + e.GetType().Name + ": " + e.Message); + General.ErrorLogger.Add(ErrorType.Warning, "Cannot lock image \"" + name + "\" for color correction. The image may not be displayed correctly.\n" + e.GetType().Name + ": " + e.Message); } // Bitmap locked? @@ -348,7 +348,7 @@ namespace CodeImp.DoomBuilder.Data { BitmapData bmpdata = null; try { bmpdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); } - catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image '" + this.filepathname + "' for glow color calculation. " + e.GetType().Name + ": " + e.Message); } + catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image \"" + this.filepathname + "\" for glow color calculation. " + e.GetType().Name + ": " + e.Message); } if(bmpdata != null) { @@ -403,7 +403,7 @@ namespace CodeImp.DoomBuilder.Data { BitmapData bmpdata = null; try { bmpdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); } - catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image '" + this.filepathname + "' for translucency check. " + e.GetType().Name + ": " + e.Message); } + catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image \"" + this.filepathname + "\" for translucency check. " + e.GetType().Name + ": " + e.Message); } if(bmpdata != null) { diff --git a/Source/Core/Data/PK3FileImage.cs b/Source/Core/Data/PK3FileImage.cs index 40dd54c4..043c0440 100644 --- a/Source/Core/Data/PK3FileImage.cs +++ b/Source/Core/Data/PK3FileImage.cs @@ -140,7 +140,7 @@ namespace CodeImp.DoomBuilder.Data // Not loaded? if(bitmap == null) { - General.ErrorLogger.Add(ErrorType.Error, "Image file '" + filepathname + "' data format could not be read, while loading texture '" + this.Name + "'"); + General.ErrorLogger.Add(ErrorType.Error, "Image file \"" + filepathname + "\" data format could not be read, while loading texture \"" + this.Name + "\""); loadfailed = true; } else diff --git a/Source/Core/Data/SimpleTextureImage.cs b/Source/Core/Data/SimpleTextureImage.cs index a354f6dd..ea71901b 100644 --- a/Source/Core/Data/SimpleTextureImage.cs +++ b/Source/Core/Data/SimpleTextureImage.cs @@ -17,8 +17,8 @@ #region ================== Namespaces using System; -using CodeImp.DoomBuilder.IO; using System.IO; +using CodeImp.DoomBuilder.IO; #endregion @@ -32,7 +32,7 @@ namespace CodeImp.DoomBuilder.Data #region ================== Variables - private string lumpname; + private readonly string lumpname; #endregion @@ -93,7 +93,7 @@ namespace CodeImp.DoomBuilder.Data // Not loaded? if(bitmap == null) { - General.ErrorLogger.Add(ErrorType.Error, "Image lump '" + lumpname + "' data format could not be read, while loading texture '" + this.Name + "'. Does this lump contain valid picture data at all?"); + General.ErrorLogger.Add(ErrorType.Error, "Image lump \"" + lumpname + "\" data format could not be read, while loading texture \"" + this.Name + "\". Does this lump contain valid picture data at all?"); loadfailed = true; } else @@ -108,7 +108,7 @@ namespace CodeImp.DoomBuilder.Data } else { - General.ErrorLogger.Add(ErrorType.Error, "Image lump '" + lumpname + "' could not be found, while loading texture '" + this.Name + "'. Did you forget to include required resources?"); + General.ErrorLogger.Add(ErrorType.Error, "Image lump \"" + lumpname + "\" could not be found, while loading texture \"" + this.Name + "\". Did you forget to include required resources?"); loadfailed = true; } diff --git a/Source/Core/Data/SpriteImage.cs b/Source/Core/Data/SpriteImage.cs index b3b8f784..458a2192 100644 --- a/Source/Core/Data/SpriteImage.cs +++ b/Source/Core/Data/SpriteImage.cs @@ -93,7 +93,7 @@ namespace CodeImp.DoomBuilder.Data if(reader is UnknownImageReader) { // Data is in an unknown format! - General.ErrorLogger.Add(ErrorType.Error, "Sprite lump '" + Name + "' data format could not be read. Does this lump contain valid picture data at all?"); + General.ErrorLogger.Add(ErrorType.Error, "Sprite lump \"" + Name + "\" data format could not be read. Does this lump contain valid picture data at all?"); bitmap = null; } else @@ -130,7 +130,7 @@ namespace CodeImp.DoomBuilder.Data else { // Missing a patch lump! - General.ErrorLogger.Add(ErrorType.Error, "Missing sprite lump '" + Name + "'. Forgot to include required resources?"); + General.ErrorLogger.Add(ErrorType.Error, "Missing sprite lump \"" + Name + "\". Forgot to include required resources?"); } // Pass on to base diff --git a/Source/Core/Data/TextureImage.cs b/Source/Core/Data/TextureImage.cs index cbda6c1f..6f82fb59 100644 --- a/Source/Core/Data/TextureImage.cs +++ b/Source/Core/Data/TextureImage.cs @@ -90,7 +90,7 @@ namespace CodeImp.DoomBuilder.Data catch(Exception e) { // Unable to make bitmap - General.ErrorLogger.Add(ErrorType.Error, "Unable to load texture image '" + this.Name + "'. " + e.GetType().Name + ": " + e.Message); + General.ErrorLogger.Add(ErrorType.Error, "Unable to load texture image \"" + this.Name + "\". " + e.GetType().Name + ": " + e.Message); loadfailed = true; } @@ -124,7 +124,7 @@ namespace CodeImp.DoomBuilder.Data if(reader is UnknownImageReader) { // Data is in an unknown format! - General.ErrorLogger.Add(ErrorType.Error, "Patch lump '" + p.lumpname + "' data format could not be read, while loading texture '" + this.Name + "'. Does this lump contain valid picture data at all?"); + General.ErrorLogger.Add(ErrorType.Error, "Patch lump \"" + p.lumpname + "\" data format could not be read, while loading texture \"" + this.Name + "\". Does this lump contain valid picture data at all?"); loadfailed = true; missingpatches++; //mxd } @@ -138,7 +138,7 @@ namespace CodeImp.DoomBuilder.Data catch(InvalidDataException) { // Data cannot be read! - General.ErrorLogger.Add(ErrorType.Error, "Patch lump '" + p.lumpname + "' data format could not be read, while loading texture '" + this.Name + "'. Does this lump contain valid picture data at all?"); + General.ErrorLogger.Add(ErrorType.Error, "Patch lump \"" + p.lumpname + "\" data format could not be read, while loading texture \"" + this.Name + "\". Does this lump contain valid picture data at all?"); loadfailed = true; missingpatches++; //mxd } @@ -150,7 +150,7 @@ namespace CodeImp.DoomBuilder.Data else { // Missing a patch lump! - General.ErrorLogger.Add(ErrorType.Error, "Missing patch lump '" + p.lumpname + "' while loading texture '" + this.Name + "'. Did you forget to include required resources?"); + General.ErrorLogger.Add(ErrorType.Error, "Missing patch lump \"" + p.lumpname + "\" while loading texture \"" + this.Name + "\". Did you forget to include required resources?"); loadfailed = true; missingpatches++; //mxd } diff --git a/Source/Core/Editing/ThingsFilter.cs b/Source/Core/Editing/ThingsFilter.cs index 872518e3..80071c2e 100644 --- a/Source/Core/Editing/ThingsFilter.cs +++ b/Source/Core/Editing/ThingsFilter.cs @@ -272,7 +272,7 @@ namespace CodeImp.DoomBuilder.Editing //Integrity check if(!IsValid()) - General.ErrorLogger.Add(ErrorType.Warning, "Things filter '" + name + "' has invalid properties. Configure the things filter to fix this!"); + General.ErrorLogger.Add(ErrorType.Warning, "Things filter \"" + name + "\" has invalid properties. Configure the things filter to fix this!"); } //mxd diff --git a/Source/Core/GZBuilder/Windows/ExceptionDialog.cs b/Source/Core/GZBuilder/Windows/ExceptionDialog.cs index 251d1893..bb71e7e7 100644 --- a/Source/Core/GZBuilder/Windows/ExceptionDialog.cs +++ b/Source/Core/GZBuilder/Windows/ExceptionDialog.cs @@ -130,7 +130,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Windows // Get OS name ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT Caption FROM Win32_OperatingSystem"); - foreach(ManagementObject mo in searcher.Get()) + foreach(ManagementBaseObject mo in searcher.Get()) { result += "OS: " + mo["Caption"] + Environment.NewLine; break; @@ -138,7 +138,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Windows // Get GPU name searcher = new ManagementObjectSearcher("SELECT * FROM Win32_VideoController"); - foreach(ManagementObject mo in searcher.Get()) + foreach(ManagementBaseObject mo in searcher.Get()) { PropertyData bpp = mo.Properties["CurrentBitsPerPixel"]; PropertyData description = mo.Properties["Description"]; diff --git a/Source/Core/GZBuilder/md3/ModelReader.cs b/Source/Core/GZBuilder/md3/ModelReader.cs index 0c75bb7b..c9383d63 100644 --- a/Source/Core/GZBuilder/md3/ModelReader.cs +++ b/Source/Core/GZBuilder/md3/ModelReader.cs @@ -102,7 +102,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3 MemoryStream ms = LoadFile(containers, mde.ModelNames[i], true); if(ms == null) { - General.ErrorLogger.Add(ErrorType.Error, "Error while loading '" + mde.ModelNames[i] + "': unable to find file."); + General.ErrorLogger.Add(ErrorType.Error, "Error while loading \"" + mde.ModelNames[i] + "\": unable to find file."); continue; } @@ -112,7 +112,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3 case ".md3": if(!string.IsNullOrEmpty(mde.FrameNames[i])) { - General.ErrorLogger.Add(ErrorType.Error, "Error while loading '" + mde.ModelNames[i] + "': frame names are not supported for MD3 models!"); + General.ErrorLogger.Add(ErrorType.Error, "Error while loading \"" + mde.ModelNames[i] + "\": frame names are not supported for MD3 models!"); continue; } result = ReadMD3Model(ref bbs, useSkins, ms, device, mde.FrameIndices[i]); @@ -131,7 +131,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3 //got errors? if(!String.IsNullOrEmpty(result.Errors)) { - General.ErrorLogger.Add(ErrorType.Error, "Error while loading '" + mde.ModelNames[i] + "': " + result.Errors); + General.ErrorLogger.Add(ErrorType.Error, "Error while loading \"" + mde.ModelNames[i] + "\": " + result.Errors); } else { @@ -164,7 +164,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3 if(Array.IndexOf(ModelData.SUPPORTED_TEXTURE_EXTENSIONS, ext) == -1) { mde.Model.Textures.Add(General.Map.Data.UnknownTexture3D.Texture); - errors.Add("image format '" + ext + "' is not supported!"); + errors.Add("image format \"" + ext + "\" is not supported!"); continue; } @@ -177,7 +177,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3 if(t == null) { mde.Model.Textures.Add(General.Map.Data.UnknownTexture3D.Texture); - errors.Add("unable to load skin '" + result.Skins[m] + "'"); + errors.Add("unable to load skin \"" + result.Skins[m] + "\""); continue; } @@ -191,7 +191,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3 if(t == null) { mde.Model.Textures.Add(General.Map.Data.UnknownTexture3D.Texture); - errors.Add("unable to load texture '" + mde.TextureNames[i] + "'"); + errors.Add("unable to load texture \"" + mde.TextureNames[i] + "\""); } else { @@ -203,7 +203,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3 if(errors.Count > 0) { foreach(string e in errors) - General.ErrorLogger.Add(ErrorType.Error, "Error while loading '" + mde.ModelNames[i] + "': " + e); + General.ErrorLogger.Add(ErrorType.Error, "Error while loading \"" + mde.ModelNames[i] + "\": " + e); } } } @@ -242,7 +242,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3 string magic = ReadString(br, 4); if(magic != "IDP3") { - result.Errors = "unknown header: expected 'IDP3', but got '" + magic + "'"; + result.Errors = "unknown header: expected \"IDP3\", but got \"" + magic + "\""; return result; } @@ -341,7 +341,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3 long start = br.BaseStream.Position; string magic = ReadString(br, 4); - if(magic != "IDP3") return "error while reading surface. Unknown header: expected 'IDP3', but got '" + magic + "'"; + if(magic != "IDP3") return "error while reading surface. Unknown header: expected \"IDP3\", but got \"" + magic + "\""; string name = ReadString(br, 64); int flags = br.ReadInt32(); @@ -432,8 +432,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3 { string magic = ReadString(br, 4); if(magic != "IDP2") //magic number: "IDP2" - { - result.Errors = "unknown header: expected 'IDP2', but got '" + magic + "'"; + { + result.Errors = "unknown header: expected \"IDP2\", but got \"" + magic + "\""; return result; } @@ -521,7 +521,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3 // No dice? Bail out! if(!framefound) { - result.Errors = "unable to find frame '" + framename + "'!"; + result.Errors = "unable to find frame \"" + framename + "\"!"; return result; } } diff --git a/Source/Core/General/FileLockChecker.cs b/Source/Core/General/FileLockChecker.cs index 1e6c6268..ec3e6f0d 100644 --- a/Source/Core/General/FileLockChecker.cs +++ b/Source/Core/General/FileLockChecker.cs @@ -176,8 +176,8 @@ namespace CodeImp.DoomBuilder foreach(Process process in result.Processes) { result.Error += Path.GetFileName(process.MainModule.FileName) - + " ('" + process.MainModule.FileName - + "', started at " + process.StartTime + ")" + + " (\"" + process.MainModule.FileName + + "\", started at " + process.StartTime + ")" + Environment.NewLine + Environment.NewLine; } } diff --git a/Source/Core/General/General.cs b/Source/Core/General/General.cs index 52bb1fe8..1392daf6 100644 --- a/Source/Core/General/General.cs +++ b/Source/Core/General/General.cs @@ -318,7 +318,7 @@ namespace CodeImp.DoomBuilder ConfigurationInfo cfginfo = new ConfigurationInfo(cfg, fullfilename); // Add to lists - General.WriteLogLine("Registered game configuration '" + cfginfo.Name + "' from '" + fullfilename + "'"); + General.WriteLogLine("Registered game configuration \"" + cfginfo.Name + "\" from \"" + fullfilename + "\""); configs.Add(cfginfo); } } @@ -369,7 +369,7 @@ namespace CodeImp.DoomBuilder catch(Exception e) { // Unable to load configuration - errorlogger.Add(ErrorType.Error, "Unable to load the nodebuilder configuration '" + de.Key + "' from \"" + Path.GetFileName(filepath) + "\". Error: " + e.Message); + errorlogger.Add(ErrorType.Error, "Unable to load the nodebuilder configuration \"" + de.Key + "\" from \"" + Path.GetFileName(filepath) + "\". Error: " + e.Message); } } } @@ -677,7 +677,7 @@ namespace CodeImp.DoomBuilder // Show any errors if preferred if(errorlogger.IsErrorAdded) { - mainwindow.DisplayStatus(StatusType.Warning, "There were errors during program statup!"); + mainwindow.DisplayStatus(StatusType.Warning, "There were errors during program startup!"); if(!delaymainwindow && General.Settings.ShowErrorsWindow) mainwindow.ShowErrors(); } @@ -707,7 +707,7 @@ namespace CodeImp.DoomBuilder if((DateTime.Now - File.GetLastWriteTime(backup)).TotalDays > 30) { File.Delete(backup); - WriteLogLine("Removed '" + backup + "' map backup."); + WriteLogLine("Removed \"" + backup + "\" map backup."); } } } @@ -859,7 +859,7 @@ namespace CodeImp.DoomBuilder catch(Exception) { } // Warn the user? - if(!portablemode) ShowWarningMessage("Failed to enable portable mode.\nMake sure you have write premission for '" + apppath + "' directory.", MessageBoxButtons.OK); + if(!portablemode) ShowWarningMessage("Failed to enable portable mode.\nMake sure you have write premission for \"" + apppath + "\" directory.", MessageBoxButtons.OK); } // Resource? else if(string.Compare(curarg, "-RESOURCE", true) == 0) @@ -1219,8 +1219,8 @@ namespace CodeImp.DoomBuilder if(changemapwindow.ShowDialog(mainwindow) != DialogResult.OK) return; // Display status - mainwindow.DisplayStatus(StatusType.Busy, "Switching to map '" + changemapwindow.Options.CurrentName + "'..."); - WriteLogLine("Switching to map '" + changemapwindow.Options.CurrentName + "'..."); + mainwindow.DisplayStatus(StatusType.Busy, "Switching to map \"" + changemapwindow.Options.CurrentName + "\"..."); + WriteLogLine("Switching to map \"" + changemapwindow.Options.CurrentName + "\"..."); Cursor.Current = Cursors.WaitCursor; diff --git a/Source/Core/General/Launcher.cs b/Source/Core/General/Launcher.cs index 305b8baa..53724eae 100644 --- a/Source/Core/General/Launcher.cs +++ b/Source/Core/General/Launcher.cs @@ -233,7 +233,7 @@ namespace CodeImp.DoomBuilder { if(process != null) { - General.ShowWarningMessage("Game engine is already running." + Environment.NewLine + "Please close '" + process.MainModule.FileName + "' first.", MessageBoxButtons.OK); + General.ShowWarningMessage("Game engine is already running." + Environment.NewLine + "Please close \"" + process.MainModule.FileName + "\" first.", MessageBoxButtons.OK); return true; } diff --git a/Source/Core/General/UpdateChecker.cs b/Source/Core/General/UpdateChecker.cs index 4f70f839..0240d43f 100644 --- a/Source/Core/General/UpdateChecker.cs +++ b/Source/Core/General/UpdateChecker.cs @@ -45,7 +45,7 @@ namespace CodeImp.DoomBuilder string updaterpath = Path.Combine(General.AppPath, "Updater.exe"); if(!File.Exists(updaterpath)) { - errordesc = "Update check failed: '" + updaterpath + "' does not exist!"; + errordesc = "Update check failed: \"" + updaterpath + "\" does not exist!"; e.Cancel = true; return; } @@ -53,7 +53,7 @@ namespace CodeImp.DoomBuilder string inipath = Path.Combine(General.AppPath, "Updater.ini"); if(!File.Exists(inipath)) { - errordesc = "Update check failed: '" + inipath + "' does not exist!"; + errordesc = "Update check failed: \"" + inipath + "\" does not exist!"; e.Cancel = true; return; } diff --git a/Source/Core/Geometry/InterpolationTools.cs b/Source/Core/Geometry/InterpolationTools.cs index 1bf15ae7..48b69bcd 100644 --- a/Source/Core/Geometry/InterpolationTools.cs +++ b/Source/Core/Geometry/InterpolationTools.cs @@ -21,7 +21,7 @@ namespace CodeImp.DoomBuilder.Geometry case Mode.EASE_IN_SINE: return EaseInSine(val1, val2, delta); case Mode.EASE_OUT_SINE: return EaseOutSine(val1, val2, delta); case Mode.EASE_IN_OUT_SINE: return EaseInOutSine(val1, val2, delta); - default: throw new NotImplementedException("InterpolationTools.Interpolate: '" + mode + "' mode is not supported!"); + default: throw new NotImplementedException("InterpolationTools.Interpolate: \"" + mode + "\" mode is not supported!"); } } diff --git a/Source/Core/Geometry/Tools.cs b/Source/Core/Geometry/Tools.cs index 4114ed62..6d865e1e 100644 --- a/Source/Core/Geometry/Tools.cs +++ b/Source/Core/Geometry/Tools.cs @@ -1832,7 +1832,7 @@ namespace CodeImp.DoomBuilder.Geometry return GetSidedefBottomOffsetY(side, offset, scaleY, fromNormalized); default: - throw new NotSupportedException("Tools.GetSidedefOffsetY: '" + part + "' geometry type is not supported!"); + throw new NotSupportedException("Tools.GetSidedefOffsetY: \"" + part + "\" geometry type is not supported!"); } } diff --git a/Source/Core/IO/Configuration.cs b/Source/Core/IO/Configuration.cs index ec88bf22..9fb7222d 100644 --- a/Source/Core/IO/Configuration.cs +++ b/Source/Core/IO/Configuration.cs @@ -804,7 +804,8 @@ namespace CodeImp.DoomBuilder.IO case "true": return true; case "false": return false; case "null": return null; - default: RaiseError(file, line, ERROR_KEYWORDUNKNOWN + "\nUnrecognized token: '" + val.Trim().ToLowerInvariant() + "'"); return null; + default: RaiseError(file, line, ERROR_KEYWORDUNKNOWN + "\nUnrecognized token: \"" + val.Trim().ToLowerInvariant() + "\""); + return null; } } } @@ -860,7 +861,7 @@ namespace CodeImp.DoomBuilder.IO } else { - RaiseError(file, line, "Include missing structure '" + args[1] + "' in file '" + includefile + "'"); + RaiseError(file, line, "Include missing structure \"" + args[1] + "\" in file \"" + includefile + "\""); return; } } @@ -885,7 +886,7 @@ namespace CodeImp.DoomBuilder.IO } catch(Exception e) { - RaiseError(file, line, "Unable to include file '" + includefile + "'. " + e.GetType().Name + ": " + e.Message); + RaiseError(file, line, "Unable to include file \"" + includefile + "\". " + e.GetType().Name + ": " + e.Message); return; } @@ -915,7 +916,7 @@ namespace CodeImp.DoomBuilder.IO } else { - RaiseError(file, line, "Include missing structure '" + args[1] + "' in file '" + includefile + "'"); + RaiseError(file, line, "Include missing structure \"" + args[1] + "\" in file \"" + includefile + "\""); return; } } diff --git a/Source/Core/IO/UniversalEntry.cs b/Source/Core/IO/UniversalEntry.cs index 5d56675a..440f46a3 100644 --- a/Source/Core/IO/UniversalEntry.cs +++ b/Source/Core/IO/UniversalEntry.cs @@ -60,7 +60,7 @@ namespace CodeImp.DoomBuilder.IO // Will throw and exception when it is not public void ValidateType(Type t) { - if(value.GetType() != t) throw new Exception("The value of entry '" + key + "' is of incompatible type (expected " + t.Name + ")"); + if(value.GetType() != t) throw new Exception("The value of entry \"" + key + "\" is of incompatible type (expected " + t.Name + ")"); } //mxd diff --git a/Source/Core/Windows/EffectBrowserForm.cs b/Source/Core/Windows/EffectBrowserForm.cs index a8744468..89d20e54 100644 --- a/Source/Core/Windows/EffectBrowserForm.cs +++ b/Source/Core/Windows/EffectBrowserForm.cs @@ -33,9 +33,8 @@ namespace CodeImp.DoomBuilder.Windows // Variables private int selectedeffect; - private ComboBox[] options; - private Label[] optionlbls; - private ListViewItem[] allItems; //mxd + private readonly ComboBox[] options; + private readonly ListViewItem[] allitems; //mxd private readonly bool addanyeffect; // Properties @@ -52,13 +51,13 @@ namespace CodeImp.DoomBuilder.Windows // Make array references for controls options = new[] { option0, option1, option2, option3, option4, option5, option6, option7 }; - optionlbls = new[] { option0label, option1label, option2label, option3label, option4label, - option5label, option6label, option7label }; + Label[] optionlbls = { option0label, option1label, option2label, option3label, + option4label, option5label, option6label, option7label }; // Go for all predefined effects bool selected = CreateEffects(effect); //mxd - allItems = new ListViewItem[effects.Items.Count]; //mxd - effects.Items.CopyTo(allItems, 0); //mxd + allitems = new ListViewItem[effects.Items.Count]; //mxd + effects.Items.CopyTo(allitems, 0); //mxd // Using generalized effects? if(General.Map.Config.GeneralizedEffects) @@ -160,7 +159,7 @@ namespace CodeImp.DoomBuilder.Windows { List filteredItems = new List(); - foreach(ListViewItem i in allItems) + foreach(ListViewItem i in allitems) { SectorEffectInfo si = i.Tag as SectorEffectInfo; if(si.Title.ToLowerInvariant().IndexOf(p) != -1) diff --git a/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs index a75e3edf..bfb39f2f 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs @@ -1095,7 +1095,7 @@ namespace CodeImp.DoomBuilder.BuilderModes if(excludedLines.Count == thingsCount) { ThingTypeInfo tti = General.Map.Data.GetThingInfo(t.Type); - General.ErrorLogger.Add(ErrorType.Warning, "Unable to align Thing ¹" + t.Index + " (" + tti.Title + ") to any linedef in a map!"); + General.ErrorLogger.Add(ErrorType.Warning, "Unable to align " + tti.Title + " (index " + t.Index + ") to any linedef!"); aligned = true; } } diff --git a/Source/Plugins/BuilderModes/FindReplace/FindSectorEffect.cs b/Source/Plugins/BuilderModes/FindReplace/FindSectorEffect.cs index 7d93a641..f51533c9 100644 --- a/Source/Plugins/BuilderModes/FindReplace/FindSectorEffect.cs +++ b/Source/Plugins/BuilderModes/FindReplace/FindSectorEffect.cs @@ -18,10 +18,10 @@ using System; using System.Collections.Generic; -using System.Windows.Forms; -using CodeImp.DoomBuilder.Map; using System.Drawing; +using System.Windows.Forms; using CodeImp.DoomBuilder.Config; +using CodeImp.DoomBuilder.Map; #endregion @@ -138,7 +138,7 @@ namespace CodeImp.DoomBuilder.BuilderModes } //mxd - private static bool BitsMatch(int effect, List expectedbits) + private static bool BitsMatch(int effect, IEnumerable expectedbits) { if(!General.Map.Config.GeneralizedEffects) return false; diff --git a/Source/Plugins/BuilderModes/IO/WavefrontExporter.cs b/Source/Plugins/BuilderModes/IO/WavefrontExporter.cs index 0a306f5f..53a07888 100644 --- a/Source/Plugins/BuilderModes/IO/WavefrontExporter.cs +++ b/Source/Plugins/BuilderModes/IO/WavefrontExporter.cs @@ -90,7 +90,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.IO ImageData id = General.Map.Data.GetTextureImage(s); if(id.Width == 0 || id.Height == 0) { - General.ErrorLogger.Add(ErrorType.Warning, "OBJ Exporter: texture '" + s + "' has invalid size (" + id.Width + "x" + id.Height + ")!"); + General.ErrorLogger.Add(ErrorType.Warning, "OBJ Exporter: texture \"" + s + "\" has invalid size (" + id.Width + "x" + id.Height + ")!"); continue; } @@ -100,7 +100,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.IO } else { - General.ErrorLogger.Add(ErrorType.Warning, "OBJ Exporter: texture '" + s + "' does not exist!"); + General.ErrorLogger.Add(ErrorType.Warning, "OBJ Exporter: texture \"" + s + "\" does not exist!"); } } } @@ -115,7 +115,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.IO ImageData id = General.Map.Data.GetFlatImage(s); if(id.Width == 0 || id.Height == 0) { - General.ErrorLogger.Add(ErrorType.Warning, "OBJ Exporter: flat '" + s + "' has invalid size (" + id.Width + "x" + id.Height + ")!"); + General.ErrorLogger.Add(ErrorType.Warning, "OBJ Exporter: flat \"" + s + "\" has invalid size (" + id.Width + "x" + id.Height + ")!"); continue; } @@ -132,7 +132,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.IO } else { - General.ErrorLogger.Add(ErrorType.Warning, "OBJ Exporter: flat '" + s + "' does not exist!"); + General.ErrorLogger.Add(ErrorType.Warning, "OBJ Exporter: flat \"" + s + "\" does not exist!"); } } } diff --git a/Source/Plugins/BuilderModes/Interface/ErrorCheckForm.cs b/Source/Plugins/BuilderModes/Interface/ErrorCheckForm.cs index 6f1d8894..63029525 100644 --- a/Source/Plugins/BuilderModes/Interface/ErrorCheckForm.cs +++ b/Source/Plugins/BuilderModes/Interface/ErrorCheckForm.cs @@ -330,16 +330,16 @@ namespace CodeImp.DoomBuilder.BuilderModes catch(TargetInvocationException ex) { // Error! - General.ErrorLogger.Add(ErrorType.Error, "Failed to create class instance '" + t.Name + "'"); + General.ErrorLogger.Add(ErrorType.Error, "Failed to create class instance \"" + t.Name + "\""); General.WriteLogLine(ex.InnerException.GetType().Name + ": " + ex.InnerException.Message); - throw ex; + throw; } catch(Exception ex) { // Error! - General.ErrorLogger.Add(ErrorType.Error, "Failed to create class instance '" + t.Name + "'"); + General.ErrorLogger.Add(ErrorType.Error, "Failed to create class instance \"" + t.Name + "\""); General.WriteLogLine(ex.GetType().Name + ": " + ex.Message); - throw ex; + throw; } // Add to list diff --git a/Source/Plugins/BuilderModes/Interface/FindReplaceForm.cs b/Source/Plugins/BuilderModes/Interface/FindReplaceForm.cs index a854965f..bd9e2300 100644 --- a/Source/Plugins/BuilderModes/Interface/FindReplaceForm.cs +++ b/Source/Plugins/BuilderModes/Interface/FindReplaceForm.cs @@ -76,14 +76,14 @@ namespace CodeImp.DoomBuilder.BuilderModes catch(TargetInvocationException ex) { // Error! - General.ErrorLogger.Add(ErrorType.Error, "Failed to create class instance '" + t.Name + "'"); + General.ErrorLogger.Add(ErrorType.Error, "Failed to create class instance \"" + t.Name + "\""); General.WriteLogLine(ex.InnerException.GetType().Name + ": " + ex.InnerException.Message); throw; } catch(Exception ex) { // Error! - General.ErrorLogger.Add(ErrorType.Error, "Failed to create class instance '" + t.Name + "'"); + General.ErrorLogger.Add(ErrorType.Error, "Failed to create class instance \"" + t.Name + "\""); General.WriteLogLine(ex.GetType().Name + ": " + ex.Message); throw; } diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs index ffbdf049..927eed51 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs @@ -3405,7 +3405,7 @@ namespace CodeImp.DoomBuilder.BuilderModes if(excludedLines.Count == thingsCount) { ThingTypeInfo tti = General.Map.Data.GetThingInfo(t.Type); - General.ErrorLogger.Add(ErrorType.Warning, "Unable to align Thing ¹" + t.Index + " (" + tti.Title + ") to any linedef in a map!"); + General.ErrorLogger.Add(ErrorType.Warning, "Unable to align " + tti.Title + " (index " + t.Index + ") to any linedef!"); aligned = true; } }