mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-27 18:30:05 +02:00
50 lines
2.2 KiB
C#
50 lines
2.2 KiB
C#
using Gommon;
|
|
using Ryujinx.HLE.Loaders.Processes;
|
|
using System;
|
|
|
|
namespace Ryujinx.UI.Common.Helper
|
|
{
|
|
public static class TitleHelper
|
|
{
|
|
public static string ActiveApplicationTitle(ProcessResult activeProcess, string applicationVersion, 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 = $"Ryujinx {applicationVersion} -{titleNameSection}{titleVersionSection}{titleIdSection}{titleArchSection}";
|
|
|
|
if (!string.IsNullOrEmpty(pauseString))
|
|
{
|
|
appTitle += $" ({pauseString})";
|
|
}
|
|
|
|
return 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);
|
|
}
|
|
}
|
|
}
|