mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-09-13 07:02:18 -06:00
Use localized game name to display on the compatibility window if the game is owned.
This commit is contained in:
@ -82,7 +82,7 @@ namespace Ryujinx.Ava.Systems
|
|||||||
static string ColStr(SepReader.Col col) => col.ToString().Trim('"');
|
static string ColStr(SepReader.Col col) => col.ToString().Trim('"');
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GameName { get; }
|
public string GameName { get; set; }
|
||||||
public Optional<string> TitleId { get; }
|
public Optional<string> TitleId { get; }
|
||||||
public string[] Labels { get; }
|
public string[] Labels { get; }
|
||||||
public LocaleKeys? Status { get; }
|
public LocaleKeys? Status { get; }
|
||||||
|
@ -47,10 +47,19 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
private void AppCountUpdated(object _, ApplicationCountUpdatedEventArgs __)
|
private void AppCountUpdated(object _, ApplicationCountUpdatedEventArgs __)
|
||||||
=> _ownedGameTitleIds = _appLibrary.Applications.Keys.Select(x => x.ToString("X16")).ToArray();
|
=> _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 => string.Equals(x.IdString, entry.TitleId, StringComparison.OrdinalIgnoreCase))?.Name ?? entry.GameName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public CompatibilityViewModel(ApplicationLibrary appLibrary)
|
public CompatibilityViewModel(ApplicationLibrary appLibrary)
|
||||||
{
|
{
|
||||||
_appLibrary = appLibrary;
|
_appLibrary = appLibrary;
|
||||||
AppCountUpdated(null, null);
|
AppCountUpdated(null, null);
|
||||||
|
LocalizeGameNames();
|
||||||
CountByStatus();
|
CountByStatus();
|
||||||
_appLibrary.ApplicationCountUpdated += AppCountUpdated;
|
_appLibrary.ApplicationCountUpdated += AppCountUpdated;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user