From 86d1f5f56aff4a52a1daaf2ed64e84a7a675622c Mon Sep 17 00:00:00 2001 From: Herp Derpinstine Date: Sat, 28 Sep 2024 23:02:48 -0600 Subject: [PATCH] Modified Command-Line Argument Logging to show Internal Arguments Only --- MelonLoader/Core.cs | 8 ++++++-- MelonLoader/MelonLaunchOptions.cs | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/MelonLoader/Core.cs b/MelonLoader/Core.cs index d688efc3..3ee54942 100644 --- a/MelonLoader/Core.cs +++ b/MelonLoader/Core.cs @@ -174,9 +174,13 @@ internal static void WelcomeMessage() var archString = MelonUtils.IsGame32Bit() ? "x86" : "x64"; MelonLogger.MsgDirect($"Game Arch: {archString}"); MelonLogger.MsgDirect("------------------------------"); - MelonLogger.MsgDirect($"Command-Line: {string.Join(" ", MelonLaunchOptions.CommandLineArgs)}"); + MelonLogger.MsgDirect("Command-Line: "); + foreach (var pair in MelonLaunchOptions.InternalArguments) + if (string.IsNullOrEmpty(pair.Value)) + MelonLogger.MsgDirect($" {pair.Key}"); + else + MelonLogger.MsgDirect($" {pair.Key} = {pair.Value}"); MelonLogger.MsgDirect("------------------------------"); - MelonEnvironment.PrintEnvironment(); } diff --git a/MelonLoader/MelonLaunchOptions.cs b/MelonLoader/MelonLaunchOptions.cs index c1f413ba..d10efc6d 100644 --- a/MelonLoader/MelonLaunchOptions.cs +++ b/MelonLoader/MelonLaunchOptions.cs @@ -16,6 +16,7 @@ public static class MelonLaunchOptions /// /// public static Dictionary ExternalArguments { get; private set; } = new Dictionary(); + public static Dictionary InternalArguments { get; private set; } = new Dictionary(); /// /// Array of All Command Line Arguments @@ -64,6 +65,7 @@ internal static void Load() // Parse Argumentless Commands if (WithoutArg.TryGetValue(noPrefixCmd, out Action withoutArgFunc)) { + InternalArguments.Add(noPrefixCmd, null); withoutArgFunc(); continue; } @@ -90,6 +92,7 @@ internal static void Load() // Parse Argument Commands if (WithArg.TryGetValue(noPrefixCmd, out Action withArgFunc)) { + InternalArguments.Add(noPrefixCmd, cmdArg); withArgFunc(cmdArg); continue; }