From 746292892d9f89acb6e3d0164ec467a541bc6019 Mon Sep 17 00:00:00 2001 From: 4sval Date: Wed, 3 Aug 2022 22:55:56 +0200 Subject: [PATCH] uh --- FModel/Enums.cs | 2 +- FModel/ViewModels/GameSelectorViewModel.cs | 2 +- .../Converters/StringToGameConverter.cs | 42 ++++++++++--------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/FModel/Enums.cs b/FModel/Enums.cs index 1b678fc1..f5b29a98 100644 --- a/FModel/Enums.cs +++ b/FModel/Enums.cs @@ -92,7 +92,7 @@ public enum FGame Gameface, [Description("Sea of Thieves")] Athena, - [Description("That Banned Panda")] + [Description("Your Beloved ™ Panda")] PandaGame } diff --git a/FModel/ViewModels/GameSelectorViewModel.cs b/FModel/ViewModels/GameSelectorViewModel.cs index 61381c67..569d0c46 100644 --- a/FModel/ViewModels/GameSelectorViewModel.cs +++ b/FModel/ViewModels/GameSelectorViewModel.cs @@ -133,7 +133,7 @@ public class GameSelectorViewModel : ViewModel if (installationList.AppName.Equals(gameName, StringComparison.OrdinalIgnoreCase)) { var pak = Directory.GetDirectories(installationList.InstallLocation, "Paks*", SearchOption.AllDirectories); - return new DetectedGame { GameName = installationList.AppName, GameDirectory = pak[0] }; + if (pak.Length > 0) return new DetectedGame { GameName = installationList.AppName, GameDirectory = pak[0] }; } } } diff --git a/FModel/Views/Resources/Converters/StringToGameConverter.cs b/FModel/Views/Resources/Converters/StringToGameConverter.cs index 1fd44fe0..1b1b6456 100644 --- a/FModel/Views/Resources/Converters/StringToGameConverter.cs +++ b/FModel/Views/Resources/Converters/StringToGameConverter.cs @@ -1,6 +1,7 @@ using System; using System.Globalization; using System.Windows.Data; +using FModel.Extensions; namespace FModel.Views.Resources.Converters; @@ -10,28 +11,29 @@ public class StringToGameConverter : IValueConverter public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - return value switch + var ret = value switch { - "Newt" => "Spellbreak", - "Nebula" => "Days Gone", - "Fortnite" => "Fortnite", - "VALORANT" => "Valorant", - "Pewee" => "Rogue Company", - "Catnip" => "Borderlands 3", - "AzaleaAlpha" => "The Cycle", - "Snoek" => "State of Decay 2", - "Rosemallow" => "The Outer Worlds", - "WorldExplorersLive" => "Battle Breakers", - "MinecraftDungeons" => "Minecraft Dungeons", - "shoebill" => "Star Wars: Jedi Fallen Order", - "a99769d95d8f400baad1f67ab5dfe508" => "Core", - "711c5e95dc094ca58e5f16bd48e751d6" => "That Banned Panda", - 381210 => "Dead By Daylight", - 578080 => "PLAYERUNKNOWN'S BATTLEGROUNDS", - 677620 => "Splitgate", - 1172620 => "Sea of Thieves", - _ => value, + "Newt" => FGame.g3, + "Nebula" => FGame.BendGame, + "Fortnite" => FGame.FortniteGame, + "VALORANT" => FGame.ShooterGame, + "Pewee" => FGame.RogueCompany, + "Catnip" => FGame.OakGame, + "AzaleaAlpha" => FGame.Prospect, + "Snoek" => FGame.StateOfDecay2, + "Rosemallow" => FGame.Indiana, + "WorldExplorersLive" => FGame.WorldExplorers, + "MinecraftDungeons" => FGame.Dungeons, + "shoebill" => FGame.SwGame, + "a99769d95d8f400baad1f67ab5dfe508" => FGame.Platform, + "711c5e95dc094ca58e5f16bd48e751d6" => FGame.PandaGame, + 381210 => FGame.DeadByDaylight, + 578080 => FGame.TslGame, + 677620 => FGame.PortalWars, + 1172620 => FGame.Athena, + _ => FGame.Unknown }; + return ret == FGame.Unknown ? value : ret.GetDescription(); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)