UI: Pretty Atmosphère mod names
This commit is contained in:
parent
a624fe64b9
commit
aa01f70f46
@ -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;
|
||||||
|
@ -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"
|
||||||
|
@ -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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user