mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-12-16 12:09:51 +00:00
Merge branch 'features/compat-local-name' into 'master'
Draft: Display localized game name in Compatibility Window See merge request [ryubing/ryujinx!82](https://git.ryujinx.app/ryubing/ryujinx/-/merge_requests/82)
This commit is contained in:
commit
94d8cc9cdd
@ -82,7 +82,7 @@ namespace Ryujinx.Ava.Systems
|
||||
static string ColStr(SepReader.Col col) => col.ToString().Trim('"');
|
||||
}
|
||||
|
||||
public string GameName { get; }
|
||||
public string GameName { get; set; }
|
||||
public Optional<string> TitleId { get; }
|
||||
public string[] Labels { get; }
|
||||
public LocaleKeys? Status { get; }
|
||||
|
||||
@ -47,10 +47,19 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
private void AppCountUpdated(object _, ApplicationCountUpdatedEventArgs __)
|
||||
=> _ownedGameTitleIds = _appLibrary.Applications.Keys.Select(x => x.ToString("X16")).ToArray();
|
||||
|
||||
private void LocalizeGameNames()
|
||||
{
|
||||
foreach (var entry in CompatibilityDatabase.Entries)
|
||||
{
|
||||
entry.GameName = _appLibrary.Applications.Items.SingleOrDefault(x => x.IdString.EqualsIgnoreCase(entry.TitleId))?.Name ?? entry.GameName;
|
||||
}
|
||||
}
|
||||
|
||||
public CompatibilityViewModel(ApplicationLibrary appLibrary)
|
||||
{
|
||||
_appLibrary = appLibrary;
|
||||
AppCountUpdated(null, null);
|
||||
LocalizeGameNames();
|
||||
CountByStatus();
|
||||
_appLibrary.ApplicationCountUpdated += AppCountUpdated;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user