aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.UI.Common/Helper/TitleHelper.cs
blob: 8b47ac38b59cc8541fe2917915f479981d3a976f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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;
        }
    }
}