mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 14:31:50 +00:00
Less message box popups, more reporting in the Errors and Warning dialog window
This commit is contained in:
parent
c53ee9c927
commit
1921c63583
3 changed files with 21 additions and 22 deletions
|
@ -256,16 +256,16 @@ namespace CodeImp.DoomBuilder
|
|||
if(cfg.ErrorResult != 0)
|
||||
{
|
||||
// Error in configuration
|
||||
ShowErrorMessage("Unable to load the game configuration file \"" + filename + "\".\n" +
|
||||
"Error near line " + cfg.ErrorLine + ": " + cfg.ErrorDescription, MessageBoxButtons.OK);
|
||||
errorlogger.Add(ErrorType.Error, "Unable to load the game configuration file \"" + filename + "\". " +
|
||||
"Error near line " + cfg.ErrorLine + ": " + cfg.ErrorDescription);
|
||||
return null;
|
||||
}
|
||||
// Check if this is a Doom Builder 2 config
|
||||
else if(cfg.ReadSetting("type", "") != "Doom Builder 2 Game Configuration")
|
||||
{
|
||||
// Old configuration
|
||||
ShowErrorMessage("Unable to load the game configuration file \"" + filename + "\".\n" +
|
||||
"This configuration is not a Doom Builder 2 game configuration.", MessageBoxButtons.OK);
|
||||
errorlogger.Add(ErrorType.Error, "Unable to load the game configuration file \"" + filename + "\". " +
|
||||
"This configuration is not a Doom Builder 2 game configuration.");
|
||||
return null;
|
||||
}
|
||||
else
|
||||
|
@ -314,7 +314,7 @@ namespace CodeImp.DoomBuilder
|
|||
catch(Exception)
|
||||
{
|
||||
// Unable to load configuration
|
||||
ShowErrorMessage("Unable to load the game configuration file \"" + filename + "\".", MessageBoxButtons.OK);
|
||||
errorlogger.Add(ErrorType.Error, "Unable to load the game configuration file \"" + filename + "\".");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -379,8 +379,8 @@ namespace CodeImp.DoomBuilder
|
|||
if(cfg.ErrorResult != 0)
|
||||
{
|
||||
// Error in configuration
|
||||
ShowErrorMessage("Unable to load the compiler configuration file \"" + Path.GetFileName(filepath) + "\".\n" +
|
||||
"Error near line " + cfg.ErrorLine + ": " + cfg.ErrorDescription, MessageBoxButtons.OK);
|
||||
errorlogger.Add(ErrorType.Error, "Unable to load the compiler configuration file \"" + Path.GetFileName(filepath) + "\". " +
|
||||
"Error near line " + cfg.ErrorLine + ": " + cfg.ErrorDescription);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -399,7 +399,7 @@ namespace CodeImp.DoomBuilder
|
|||
catch(Exception e)
|
||||
{
|
||||
// Unable to load configuration
|
||||
ShowErrorMessage("Unable to load the nodebuilder configuration '" + de.Key.ToString() + "' from \"" + Path.GetFileName(filepath) + "\". Error: " + e.Message, MessageBoxButtons.OK);
|
||||
errorlogger.Add(ErrorType.Error, "Unable to load the nodebuilder configuration '" + de.Key.ToString() + "' from \"" + Path.GetFileName(filepath) + "\". Error: " + e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -408,7 +408,7 @@ namespace CodeImp.DoomBuilder
|
|||
catch(Exception)
|
||||
{
|
||||
// Unable to load configuration
|
||||
ShowErrorMessage("Unable to load the compiler configuration file \"" + Path.GetFileName(filepath) + "\".", MessageBoxButtons.OK);
|
||||
errorlogger.Add(ErrorType.Error, "Unable to load the compiler configuration file \"" + Path.GetFileName(filepath) + "\".");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -441,8 +441,8 @@ namespace CodeImp.DoomBuilder
|
|||
if(cfg.ErrorResult != 0)
|
||||
{
|
||||
// Error in configuration
|
||||
ShowErrorMessage("Unable to load the script configuration file \"" + Path.GetFileName(filepath) + "\".\n" +
|
||||
"Error near line " + cfg.ErrorLine + ": " + cfg.ErrorDescription, MessageBoxButtons.OK);
|
||||
errorlogger.Add(ErrorType.Error, "Unable to load the script configuration file \"" + Path.GetFileName(filepath) + "\". " +
|
||||
"Error near line " + cfg.ErrorLine + ": " + cfg.ErrorDescription);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -456,14 +456,14 @@ namespace CodeImp.DoomBuilder
|
|||
catch(Exception e)
|
||||
{
|
||||
// Unable to load configuration
|
||||
ShowErrorMessage("Unable to load the script configuration \"" + Path.GetFileName(filepath) + "\". Error: " + e.Message, MessageBoxButtons.OK);
|
||||
errorlogger.Add(ErrorType.Error, "Unable to load the script configuration \"" + Path.GetFileName(filepath) + "\". Error: " + e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
// Unable to load configuration
|
||||
ShowErrorMessage("Unable to load the script configuration file \"" + Path.GetFileName(filepath) + "\". Error: " + e.Message, MessageBoxButtons.OK);
|
||||
errorlogger.Add(ErrorType.Error, "Unable to load the script configuration file \"" + Path.GetFileName(filepath) + "\". Error: " + e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -495,8 +495,8 @@ namespace CodeImp.DoomBuilder
|
|||
if(cfg.ErrorResult != 0)
|
||||
{
|
||||
// Error in configuration
|
||||
ShowErrorMessage("Unable to load the compiler configuration file \"" + Path.GetFileName(filepath) + "\".\n" +
|
||||
"Error near line " + cfg.ErrorLine + ": " + cfg.ErrorDescription, MessageBoxButtons.OK);
|
||||
errorlogger.Add(ErrorType.Error, "Unable to load the compiler configuration file \"" + Path.GetFileName(filepath) + "\". " +
|
||||
"Error near line " + cfg.ErrorLine + ": " + cfg.ErrorDescription);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -525,7 +525,7 @@ namespace CodeImp.DoomBuilder
|
|||
catch(Exception)
|
||||
{
|
||||
// Unable to load configuration
|
||||
ShowErrorMessage("Unable to load the compiler configuration file \"" + Path.GetFileName(filepath) + "\".", MessageBoxButtons.OK);
|
||||
errorlogger.Add(ErrorType.Error, "Unable to load the compiler configuration file \"" + Path.GetFileName(filepath) + "\".");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,8 +67,9 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
public Plugin(string filename)
|
||||
{
|
||||
// Initialize
|
||||
string shortfilename = Path.GetFileName(filename);
|
||||
name = Path.GetFileNameWithoutExtension(filename);
|
||||
General.WriteLogLine("Loading plugin '" + name + "' from '" + Path.GetFileName(filename) + "'...");
|
||||
General.WriteLogLine("Loading plugin '" + name + "' from '" + shortfilename + "'...");
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -77,7 +78,7 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
}
|
||||
catch(Exception)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Could not load plugin '" + name + "', the DLL file could not be read.");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Could not load plugin \"" + shortfilename + "\", the DLL file could not be read. This file is not supposed to be in the Plugins subdirectory.");
|
||||
throw new InvalidProgramException();
|
||||
}
|
||||
|
||||
|
@ -89,7 +90,7 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
if(FindClasses(typeof(Plug)).Length > 1)
|
||||
{
|
||||
// Show a warning
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Plugin '" + name + "' has more than one plug.");
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Plugin \"" + shortfilename + "\" has more than one plug.");
|
||||
}
|
||||
|
||||
// Make plug instance
|
||||
|
@ -99,7 +100,7 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
else
|
||||
{
|
||||
// How can we plug something in without a plug?
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Could not load plugin '" + name + "', plugin is missing the plug.");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Could not load plugin \"" + shortfilename + "\", plugin is missing the plug. This file is not supposed to be in the Plugins subdirectory.");
|
||||
throw new InvalidProgramException();
|
||||
}
|
||||
|
||||
|
|
|
@ -109,14 +109,12 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
foreach(string fn in filenames)
|
||||
{
|
||||
// Load plugin from this file
|
||||
General.MainWindow.DisplayStatus(StatusType.Busy, "Loading plugin '" + Path.GetFileName(fn) + "'...");
|
||||
try
|
||||
{
|
||||
p = new Plugin(fn);
|
||||
}
|
||||
catch(InvalidProgramException)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Plugin file '" + Path.GetFileName(fn) + "' was not loaded.");
|
||||
p = null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue