private bool ProcessCommandLineArgumentsAndReturnWhetherToShowWelcomeScreen()
{
bool compileAndExit = false;
bool forceRebuild;
foreach (string arg in _commandLineArgs)
{
if (arg.ToLower() == "/compile")
{
compileAndExit = true;
}
else if (arg.StartsWith("/") || arg.StartsWith("-"))
{
this.ShowMessage("Invalid command line argument " + arg, MessageBoxIcon.Warning);
}
else
{
if (!File.Exists(arg))
{
this.ShowMessage("Unable to load the game '" + arg + "' because it does not exist", MessageBoxIcon.Warning);
}
else if (_interactiveTasks.LoadGameFromDisk(arg))
{
if (compileAndExit)
{
forceRebuild = _agsEditor.NeedsRebuildForDebugMode();
if (forceRebuild)
_agsEditor.SaveGameFiles();
if (!_agsEditor.CompileGame(forceRebuild, false).HasErrors)
{
_batchProcessShutdown = true;
this.ExitApplication();
}
}
return false;
}
}
}
return true;
}