mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2025-08-30 07:25:05 +00:00
Some checks are pending
Canary release job / Create tag (push) Waiting to run
Canary release job / Release for linux-arm64 (push) Waiting to run
Canary release job / Release for linux-x64 (push) Waiting to run
Canary release job / Release for win-x64 (push) Waiting to run
Canary release job / Release MacOS universal (push) Waiting to run
43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using Avalonia.Data.Converters;
|
|
using Avalonia.Markup.Xaml;
|
|
using Ryujinx.Ava.Common.Locale;
|
|
using Ryujinx.Ava.Utilities.AppLibrary;
|
|
using System;
|
|
using System.Globalization;
|
|
|
|
namespace Ryujinx.Ava.UI.Helpers
|
|
{
|
|
internal class MultiplayerInfoConverter : MarkupExtension, IValueConverter
|
|
{
|
|
private static readonly MultiplayerInfoConverter _instance = new();
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value is ApplicationData applicationData)
|
|
{
|
|
if (applicationData.PlayerCount != 0 && applicationData.GameCount != 0)
|
|
{
|
|
return $"Hosted Games: {applicationData.GameCount}\nOnline Players: {applicationData.PlayerCount}";
|
|
}
|
|
else
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotSupportedException();
|
|
}
|
|
|
|
public override object ProvideValue(IServiceProvider serviceProvider)
|
|
{
|
|
return _instance;
|
|
}
|
|
}
|
|
}
|