mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-04-24 06:47:44 +02:00
UI: Use Hosted Games & Player Count localization keys in list view too
This commit is contained in:
parent
717851985e
commit
4ae9f1c0d2
1 changed files with 13 additions and 6 deletions
|
@ -1,8 +1,11 @@
|
||||||
using Avalonia.Data.Converters;
|
using Avalonia.Data.Converters;
|
||||||
using Avalonia.Markup.Xaml;
|
using Avalonia.Markup.Xaml;
|
||||||
|
using Gommon;
|
||||||
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.Utilities.AppLibrary;
|
using Ryujinx.Ava.Utilities.AppLibrary;
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.Helpers
|
namespace Ryujinx.Ava.UI.Helpers
|
||||||
{
|
{
|
||||||
|
@ -12,13 +15,17 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||||
|
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (value is ApplicationData { HasLdnGames: true } applicationData)
|
if (value is not ApplicationData { HasLdnGames: true } applicationData)
|
||||||
{
|
return "";
|
||||||
return $"Hosted Games: {applicationData.GameCount}\nOnline Players: {applicationData.PlayerCount}";
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
|
|
||||||
|
return new StringBuilder()
|
||||||
|
.AppendLine(
|
||||||
|
LocaleManager.Instance[LocaleKeys.GameListHeaderHostedGames]
|
||||||
|
.Format(applicationData.GameCount))
|
||||||
|
.Append(
|
||||||
|
LocaleManager.Instance[LocaleKeys.GameListHeaderPlayerCount]
|
||||||
|
.Format(applicationData.PlayerCount))
|
||||||
|
.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
|
Loading…
Add table
Reference in a new issue