diff --git a/src/Ryujinx/UI/Models/ModModel.cs b/src/Ryujinx/UI/Models/ModModel.cs index ee28ca5f5..a713f8e36 100644 --- a/src/Ryujinx/UI/Models/ModModel.cs +++ b/src/Ryujinx/UI/Models/ModModel.cs @@ -1,5 +1,5 @@ using Ryujinx.Ava.UI.ViewModels; -using System.IO; +using System.Globalization; namespace Ryujinx.Ava.UI.Models { @@ -21,6 +21,11 @@ namespace Ryujinx.Ava.UI.Models public string Path { get; } public string Name { get; } + public string FormattedName => + InSd && ulong.TryParse(Name, NumberStyles.HexNumber, null, out ulong applicationId) + ? $"Atmosphère: {System.IO.Path.GetFileNameWithoutExtension(RyujinxApp.MainWindow.ApplicationLibrary.GetNameForApplicationId(applicationId))}" + : Name; + public ModModel(string path, string name, bool enabled, bool inSd) { Path = path; diff --git a/src/Ryujinx/UI/Windows/ModManagerWindow.axaml b/src/Ryujinx/UI/Windows/ModManagerWindow.axaml index a8fd3a2e7..b50ea2c8e 100644 --- a/src/Ryujinx/UI/Windows/ModManagerWindow.axaml +++ b/src/Ryujinx/UI/Windows/ModManagerWindow.axaml @@ -81,7 +81,7 @@ MaxLines="2" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" - Text="{Binding Name}" /> + Text="{Binding FormattedName}" /> + /// Gets a name for an available content file based on the Application ID ''. + ///

+ /// For Applications, this returns the localized name of the app found in the file. + /// For DLCs, this returns the name of the file that contains the DLC, minus the file extension. + /// + /// The Application ID to search for. + /// + /// If the provided Application ID does not have a corresponding Application OR DLC file, + /// formatted as hexadecimal is returned. + /// + /// A formatted Application name, or as hexadecimal if none is found. + public string GetNameForApplicationId(ulong id) + { + DynamicData.Kernel.Optional appData = Applications.Lookup(id); + if (appData.HasValue) + return appData.Value.Name; + + if (DownloadableContents.Keys.FindFirst(x => x.TitleId == id).TryGet(out DownloadableContentModel dlcData)) + return dlcData.FileName; + + return id.ToString("X16"); + } + /// The configured key set is missing a key. /// The NCA header could not be decrypted. /// The NCA version is not supported.