UI: Pretty Atmosphère mod names

This commit is contained in:
Evan Husted 2025-01-29 17:56:43 -06:00
parent a624fe64b9
commit aa01f70f46
3 changed files with 20 additions and 2 deletions

View File

@ -1,5 +1,5 @@
using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Ava.UI.ViewModels;
using System.IO; using System.Globalization;
namespace Ryujinx.Ava.UI.Models namespace Ryujinx.Ava.UI.Models
{ {
@ -21,6 +21,11 @@ namespace Ryujinx.Ava.UI.Models
public string Path { get; } public string Path { get; }
public string Name { 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) public ModModel(string path, string name, bool enabled, bool inSd)
{ {
Path = path; Path = path;

View File

@ -81,7 +81,7 @@
MaxLines="2" MaxLines="2"
TextWrapping="Wrap" TextWrapping="Wrap"
TextTrimming="CharacterEllipsis" TextTrimming="CharacterEllipsis"
Text="{Binding Name}" /> Text="{Binding FormattedName}" />
<StackPanel <StackPanel
Grid.Column="1" Grid.Column="1"
Spacing="10" Spacing="10"

View File

@ -111,6 +111,19 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
return data; return data;
} }
public string GetNameForApplicationId(ulong id)
{
DynamicData.Kernel.Optional<ApplicationData> appData = Applications.Lookup(id);
if (appData.HasValue)
return appData.Value.Name;
Gommon.Optional<DownloadableContentModel> dlcData = DownloadableContents.Keys.FindFirst(x => x.TitleId == id);
if (dlcData.HasValue)
return dlcData.Value.FileName;
return id.ToString("X16");
}
/// <exception cref="LibHac.Common.Keys.MissingKeyException">The configured key set is missing a key.</exception> /// <exception cref="LibHac.Common.Keys.MissingKeyException">The configured key set is missing a key.</exception>
/// <exception cref="InvalidDataException">The NCA header could not be decrypted.</exception> /// <exception cref="InvalidDataException">The NCA header could not be decrypted.</exception>
/// <exception cref="NotSupportedException">The NCA version is not supported.</exception> /// <exception cref="NotSupportedException">The NCA version is not supported.</exception>