mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-01-11 20:10:38 +00:00
Some checks failed
Canary CI / Release for linux-arm64 (push) Has been cancelled
Canary CI / Release for linux-x64 (push) Has been cancelled
Canary CI / Release for win-x64 (push) Has been cancelled
Canary CI / Release MacOS universal (push) Has been cancelled
Canary CI / Create GitLab Release (push) Has been cancelled
See merge request ryubing/ryujinx!242
45 lines
2.3 KiB
C#
45 lines
2.3 KiB
C#
using Gommon;
|
|
using Ryujinx.HLE.Loaders.Processes;
|
|
|
|
namespace Ryujinx.Ava.Utilities
|
|
{
|
|
public static class TitleHelper
|
|
{
|
|
public static string ActiveApplicationTitle(ProcessResult activeProcess, string applicationVersion, bool customTitlebar, string pauseString = "")
|
|
{
|
|
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 appTitle = customTitlebar
|
|
? $"Ryujinx {applicationVersion}\n{titleNameSection.Trim()}\n{titleVersionSection.Trim()}\n{titleIdSection.Trim()}{titleArchSection}"
|
|
: $"Ryujinx {applicationVersion} -{titleNameSection}{titleVersionSection}{titleIdSection}{titleArchSection}";
|
|
|
|
return !string.IsNullOrEmpty(pauseString)
|
|
? appTitle + $" ({pauseString})"
|
|
: appTitle;
|
|
}
|
|
|
|
public static string FormatRenderDocCaptureTitle(ProcessResult activeProcess, string applicationVersion)
|
|
{
|
|
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)";
|
|
|
|
return CommandLineState.RenderDocCaptureTitleFormat
|
|
.ReplaceIgnoreCase("{EmuVersion}", applicationVersion)
|
|
.ReplaceIgnoreCase("{GuestName}", titleNameSection)
|
|
.ReplaceIgnoreCase("{GuestVersion}", titleVersionSection)
|
|
.ReplaceIgnoreCase("{GuestTitleId}", titleIdSection)
|
|
.ReplaceIgnoreCase("{GuestArch}", titleArchSection);
|
|
}
|
|
}
|
|
}
|