From e2713956ce5eaf4339365ae695dc5f57f3afd6ff Mon Sep 17 00:00:00 2001 From: sweiland-openrails <118388365+sweiland-openrails@users.noreply.github.com> Date: Sat, 2 Dec 2023 10:37:42 +0100 Subject: [PATCH 1/3] Extra line with all the arguments for debugging purposes --- .../Viewer3D/Processes/GameStateRunActivity.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/RunActivity/Viewer3D/Processes/GameStateRunActivity.cs b/Source/RunActivity/Viewer3D/Processes/GameStateRunActivity.cs index ea6d7352e..023650416 100644 --- a/Source/RunActivity/Viewer3D/Processes/GameStateRunActivity.cs +++ b/Source/RunActivity/Viewer3D/Processes/GameStateRunActivity.cs @@ -819,6 +819,19 @@ void InitLogging(UserSettings settings, string[] args, bool appendLog) Console.WriteLine("Executable = {0}", Path.GetFileName(Application.ExecutablePath)); foreach (var arg in args) Console.WriteLine("Argument = {0}", arg); +#if DEBUG + string debugArgline = ""; + foreach (var arg in args) + { + if (arg.Contains(" ")) { + debugArgline += "\"" + arg + "\" "; + } else + { + debugArgline += arg + " "; + } + } + Console.WriteLine("Arguments = {0}", debugArgline.TrimEnd()); +#endif LogSeparator(); settings.Log(); LogSeparator(); From d7a19ee6afd817d7d6599c5476cfc6d3ce3982b7 Mon Sep 17 00:00:00 2001 From: sweiland-openrails <118388365+sweiland-openrails@users.noreply.github.com> Date: Mon, 18 Dec 2023 10:30:48 +0100 Subject: [PATCH 2/3] Update GameStateRunActivity.cs Extra line containing debug arguments also in non-debug compiled mode --- .../RunActivity/Viewer3D/Processes/GameStateRunActivity.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/RunActivity/Viewer3D/Processes/GameStateRunActivity.cs b/Source/RunActivity/Viewer3D/Processes/GameStateRunActivity.cs index 023650416..a18b98645 100644 --- a/Source/RunActivity/Viewer3D/Processes/GameStateRunActivity.cs +++ b/Source/RunActivity/Viewer3D/Processes/GameStateRunActivity.cs @@ -231,7 +231,7 @@ internal override void Load() default: MessageBox.Show("To start " + Application.ProductName + ", please run 'OpenRails.exe'.\n\n" + "If you are attempting to debug this component, please run 'OpenRails.exe' and execute the scenario you are interested in. " - + "In the log file, the command-line arguments used will be listed at the top. " + + "In the log file, a line with the command-line arguments used will be listed at the top. " + "You should then configure your debug environment to execute this component with those command-line arguments.", Application.ProductName + " " + VersionInfo.VersionOrBuild); Game.Exit(); @@ -819,7 +819,7 @@ void InitLogging(UserSettings settings, string[] args, bool appendLog) Console.WriteLine("Executable = {0}", Path.GetFileName(Application.ExecutablePath)); foreach (var arg in args) Console.WriteLine("Argument = {0}", arg); -#if DEBUG + string debugArgline = ""; foreach (var arg in args) { @@ -831,7 +831,7 @@ void InitLogging(UserSettings settings, string[] args, bool appendLog) } } Console.WriteLine("Arguments = {0}", debugArgline.TrimEnd()); -#endif + LogSeparator(); settings.Log(); LogSeparator(); From 2d1b44a2b53e11f11b3bbde5dbc5efeb838c5bcf Mon Sep 17 00:00:00 2001 From: sweiland-openrails <118388365+sweiland-openrails@users.noreply.github.com> Date: Wed, 20 Dec 2023 14:04:39 +0100 Subject: [PATCH 3/3] Update GameStateRunActivity.cs { and } of if on separate lines --- .../RunActivity/Viewer3D/Processes/GameStateRunActivity.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/RunActivity/Viewer3D/Processes/GameStateRunActivity.cs b/Source/RunActivity/Viewer3D/Processes/GameStateRunActivity.cs index a18b98645..a80b6e845 100644 --- a/Source/RunActivity/Viewer3D/Processes/GameStateRunActivity.cs +++ b/Source/RunActivity/Viewer3D/Processes/GameStateRunActivity.cs @@ -823,9 +823,11 @@ void InitLogging(UserSettings settings, string[] args, bool appendLog) string debugArgline = ""; foreach (var arg in args) { - if (arg.Contains(" ")) { + if (arg.Contains(" ")) + { debugArgline += "\"" + arg + "\" "; - } else + } + else { debugArgline += arg + " "; }