first commit

This commit is contained in:
2025-07-06 00:23:46 +02:00
commit 38f50c8819
1788 changed files with 112878 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using System;
using System.Globalization;
using Avalonia.Media.Imaging;
using Nitrox.Launcher.Models.Utils;
using NitroxModel.Discovery.Models;
namespace Nitrox.Launcher.Models.Converters;
public class PlatformToIconConverter : Converter<PlatformToIconConverter>
{
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return AssetHelper.GetAssetFromStream(GetIconPathForPlatform(value as Platform?), static stream => new Bitmap(stream));
}
private static string GetIconPathForPlatform(Platform? platform) => platform switch
{
Platform.EPIC => "/Assets/Images/store-icons/epic.png",
Platform.STEAM => "/Assets/Images/store-icons/steam.png",
Platform.MICROSOFT => "/Assets/Images/store-icons/xbox.png",
Platform.DISCORD => "/Assets/Images/store-icons/discord.png",
_ => "/Assets/Images/store-icons/missing.png",
};
}