diff --git a/FModel/Helper.cs b/FModel/Helper.cs index 8e1586c8..cee8cb20 100644 --- a/FModel/Helper.cs +++ b/FModel/Helper.cs @@ -16,6 +16,11 @@ public static class Helper internal readonly ulong UlongValue; } + public static bool IAmThePanda(string key) + => key.Length == 11 && + key.StartsWith("mu", StringComparison.OrdinalIgnoreCase) && + key.EndsWith("sus", StringComparison.OrdinalIgnoreCase); + public static void OpenWindow(string windowName, Action action) where T : Window { if (!IsWindowOpen(windowName)) @@ -84,4 +89,4 @@ public static class Helper var d = (Math.Abs(d1) + Math.Abs(d2) + 10) * 1.0e-15; return -d < n && d > n; } -} \ No newline at end of file +} diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index b88304bb..c1eeb273 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -103,7 +103,8 @@ public class CUE4ParseViewModel : ViewModel } default: { - Game = gameDirectory.SubstringBeforeLast("\\Content").SubstringAfterLast("\\").ToEnum(FGame.Unknown); + var parent = gameDirectory.SubstringBeforeLast("\\Content").SubstringAfterLast("\\"); + Game = Helper.IAmThePanda(parent) ? FGame.PandaGame : parent.ToEnum(FGame.Unknown); var versions = new VersionContainer(UserSettings.Default.OverridedGame[Game], UserSettings.Default.OverridedPlatform, customVersions: UserSettings.Default.OverridedCustomVersions[Game], optionOverrides: UserSettings.Default.OverridedOptions[Game]); @@ -275,11 +276,7 @@ public class CUE4ParseViewModel : ViewModel file.FileCount = vfs.FileCount; } - if (Provider.GameName.Length == 11 && - Provider.GameName.StartsWith("mu") && - Provider.GameName.EndsWith("sus")) - Game = FGame.PandaGame; - else Game = Provider.GameName.ToEnum(Game); + Game = Helper.IAmThePanda(Provider.GameName) ? FGame.PandaGame : Provider.GameName.ToEnum(Game); }); }