aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Ui.Common/Helper
diff options
context:
space:
mode:
authorgnisman <gleb.nisman@gmail.com>2023-12-04 18:52:25 +0200
committerGitHub <noreply@github.com>2023-12-04 17:52:25 +0100
commit93aeecc4f337325ed11e3a0a72dd85768db6618f (patch)
treeef79566a77502043bbafe141cb24b64d85420abe /src/Ryujinx.Ui.Common/Helper
parent2989c163a891c4ac730e799e1457b1bfb2ecc028 (diff)
Improve indication of emulation being paused by the User (#5836)
* Improve indication of emulation being paused by the User * Use localised for Paused * Backup original title - PR comments fix * Add common helper method to assemble App title
Diffstat (limited to 'src/Ryujinx.Ui.Common/Helper')
-rw-r--r--src/Ryujinx.Ui.Common/Helper/TitleHelper.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/Ryujinx.Ui.Common/Helper/TitleHelper.cs b/src/Ryujinx.Ui.Common/Helper/TitleHelper.cs
new file mode 100644
index 00000000..089b5215
--- /dev/null
+++ b/src/Ryujinx.Ui.Common/Helper/TitleHelper.cs
@@ -0,0 +1,30 @@
+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;
+ }
+ }
+}