diff --git a/src/Ryujinx/Utilities/CommandLineState.cs b/src/Ryujinx/Utilities/CommandLineState.cs index 28f302e9d..a4e6cd811 100644 --- a/src/Ryujinx/Utilities/CommandLineState.cs +++ b/src/Ryujinx/Utilities/CommandLineState.cs @@ -19,6 +19,9 @@ namespace Ryujinx.Ava.Utilities public static string OverrideSystemLanguage { get; private set; } public static string OverrideHideCursor { get; private set; } public static string BaseDirPathArg { get; private set; } + + public static string RenderDocCaptureTitleFormat { get; private set; } = + "{EmuVersion}\n{GuestName} {GuestVersion} {GuestTitleId} {GuestArch}"; public static Optional FirmwareToInstallPathArg { get; set; } public static string Profile { get; private set; } public static string LaunchPathArg { get; private set; } @@ -54,6 +57,20 @@ namespace Ryujinx.Ava.Utilities BaseDirPathArg = args[++i]; + arguments.Add(arg); + arguments.Add(args[i]); + break; + case "-rdct": + case "--rd-capture-title-format": + if (i + 1 >= args.Length) + { + Logger.Error?.Print(LogClass.Application, $"Invalid option '{arg}'"); + + continue; + } + + RenderDocCaptureTitleFormat = args[++i]; + arguments.Add(arg); arguments.Add(args[i]); break; diff --git a/src/Ryujinx/Utilities/TitleHelper.cs b/src/Ryujinx/Utilities/TitleHelper.cs index b03ce33f4..1ded61dbd 100644 --- a/src/Ryujinx/Utilities/TitleHelper.cs +++ b/src/Ryujinx/Utilities/TitleHelper.cs @@ -1,3 +1,4 @@ +using Gommon; using Ryujinx.HLE.Loaders.Processes; namespace Ryujinx.Ava.Utilities @@ -28,12 +29,17 @@ namespace Ryujinx.Ava.Utilities if (activeProcess == null) return string.Empty; - string titleNameSection = string.IsNullOrWhiteSpace(activeProcess.Name) ? string.Empty : $" {activeProcess.Name}"; - string titleVersionSection = string.IsNullOrWhiteSpace(activeProcess.DisplayVersion) ? string.Empty : $" v{activeProcess.DisplayVersion}"; - string titleIdSection = $" ({activeProcess.ProgramIdText.ToUpper()})"; - string titleArchSection = activeProcess.Is64Bit ? " (64-bit)" : " (32-bit)"; + string titleNameSection = string.IsNullOrWhiteSpace(activeProcess.Name) ? string.Empty : activeProcess.Name; + string titleVersionSection = string.IsNullOrWhiteSpace(activeProcess.DisplayVersion) ? string.Empty : $"v{activeProcess.DisplayVersion}"; + string titleIdSection = $"({activeProcess.ProgramIdText.ToUpper()})"; + string titleArchSection = activeProcess.Is64Bit ? "(64-bit)" : "(32-bit)"; - return $"{applicationVersion}\n{titleNameSection}{titleVersionSection}{titleIdSection}{titleArchSection}"; + return CommandLineState.RenderDocCaptureTitleFormat + .ReplaceIgnoreCase("{EmuVersion}", applicationVersion) + .ReplaceIgnoreCase("{GuestName}", titleNameSection) + .ReplaceIgnoreCase("{GuestVersion}", titleVersionSection) + .ReplaceIgnoreCase("{GuestTitleId}", titleIdSection) + .ReplaceIgnoreCase("{GuestArch}", titleArchSection); } } }