From a184a258ab3b806cc012e81769219e6539e45507 Mon Sep 17 00:00:00 2001 From: 4sval Date: Tue, 13 Jun 2023 23:54:09 +0200 Subject: [PATCH 1/7] explicit ue version --- CUE4Parse | 2 +- FModel/Settings/UserSettings.cs | 2 +- FModel/ViewModels/ApplicationViewModel.cs | 1 + FModel/ViewModels/CUE4ParseViewModel.cs | 4 +- FModel/ViewModels/GameSelectorViewModel.cs | 80 +++++++++++----------- FModel/Views/DirectorySelector.xaml | 41 ++++++----- FModel/Views/DirectorySelector.xaml.cs | 4 +- FModel/Views/SettingsView.xaml | 4 +- 8 files changed, 73 insertions(+), 65 deletions(-) diff --git a/CUE4Parse b/CUE4Parse index 2666e11a..eb9ad66c 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 2666e11af8aa93222a07ac8513f5257af51304ce +Subproject commit eb9ad66c5b1be089ea2b92f33dd299b291e13de1 diff --git a/FModel/Settings/UserSettings.cs b/FModel/Settings/UserSettings.cs index bfe43db7..99af5eef 100644 --- a/FModel/Settings/UserSettings.cs +++ b/FModel/Settings/UserSettings.cs @@ -156,7 +156,7 @@ namespace FModel.Settings set => SetProperty(ref _audioPlayerVolume, value); } - private ELoadingMode _loadingMode = ELoadingMode.Multiple; + private ELoadingMode _loadingMode = ELoadingMode.All; public ELoadingMode LoadingMode { get => _loadingMode; diff --git a/FModel/ViewModels/ApplicationViewModel.cs b/FModel/ViewModels/ApplicationViewModel.cs index c908d0be..7db8e534 100644 --- a/FModel/ViewModels/ApplicationViewModel.cs +++ b/FModel/ViewModels/ApplicationViewModel.cs @@ -100,6 +100,7 @@ public class ApplicationViewModel : ViewModel if (!result.HasValue || !result.Value) return; UserSettings.Default.GameDirectory = gameLauncherViewModel.SelectedDetectedGame.GameDirectory; + // UserSettings.Default.GameDirectory = gameLauncherViewModel.SelectedDetectedGame.OverridedGame; if (!bAlreadyLaunched || gameDirectory == gameLauncherViewModel.SelectedDetectedGame.GameDirectory) return; RestartWithWarning(); diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 265839ba..e07fb076 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -458,10 +458,8 @@ public class CUE4ParseViewModel : ViewModel FLogger.Text("Additive animations have their reference pose stripped, which will lead to inaccurate preview and export", Constants.WHITE, true)); continue; case "r.StaticMesh.KeepMobileMinLODSettingOnDesktop": - Provider.Versions["StaticMesh.KeepMobileMinLODSettingOnDesktop"] = boolValue; - continue; case "r.SkeletalMesh.KeepMobileMinLODSettingOnDesktop": - Provider.Versions["SkeletalMesh.KeepMobileMinLODSettingOnDesktop"] = boolValue; + Provider.Versions[it.Key[2..]] = boolValue; continue; } } diff --git a/FModel/ViewModels/GameSelectorViewModel.cs b/FModel/ViewModels/GameSelectorViewModel.cs index 1ffa43bf..1202490e 100644 --- a/FModel/ViewModels/GameSelectorViewModel.cs +++ b/FModel/ViewModels/GameSelectorViewModel.cs @@ -22,11 +22,11 @@ public class GameSelectorViewModel : ViewModel { public string GameName { get; set; } public string GameDirectory { get; set; } + public EGame OverridedGame { get; set; } public bool IsManual { get; set; } // the followings are only used when game is manually added public AesResponse AesKeys { get; set; } - public EGame OverridedGame { get; set; } public List OverridedCustomVersions { get; set; } public Dictionary OverridedOptions { get; set; } public Dictionary> OverridedMapStructTypes { get; set; } @@ -42,6 +42,7 @@ public class GameSelectorViewModel : ViewModel private readonly ObservableCollection _autoDetectedGames; public ReadOnlyObservableCollection AutoDetectedGames { get; } + public ReadOnlyObservableCollection UeGames { get; private set; } public GameSelectorViewModel(string gameDirectory) { @@ -59,6 +60,8 @@ public class GameSelectorViewModel : ViewModel AddUnknownGame(gameDirectory); else SelectedDetectedGame = AutoDetectedGames.FirstOrDefault(); + + UeGames = new ReadOnlyObservableCollection(new ObservableCollection(EnumerateUeGames())); } /// @@ -97,39 +100,36 @@ public class GameSelectorViewModel : ViewModel SelectedDetectedGame = AutoDetectedGames.Last(); } + private IEnumerable EnumerateUeGames() => Enum.GetValues(); + private IEnumerable EnumerateDetectedGames() { - yield return GetUnrealEngineGame("Fortnite", "\\FortniteGame\\Content\\Paks"); - yield return new DetectedGame { GameName = "Fortnite [LIVE]", GameDirectory = Constants._FN_LIVE_TRIGGER }; - yield return GetUnrealEngineGame("Pewee", "\\RogueCompany\\Content\\Paks"); - yield return GetUnrealEngineGame("Rosemallow", "\\Indiana\\Content\\Paks"); - yield return GetUnrealEngineGame("Catnip", "\\OakGame\\Content\\Paks"); - yield return GetUnrealEngineGame("AzaleaAlpha", "\\Prospect\\Content\\Paks"); - yield return GetUnrealEngineGame("WorldExplorersLive", "\\WorldExplorers\\Content\\Paks"); - yield return GetUnrealEngineGame("Newt", "\\g3\\Content\\Paks"); - yield return GetUnrealEngineGame("shoebill", "\\SwGame\\Content\\Paks"); - yield return GetUnrealEngineGame("Snoek", "\\StateOfDecay2\\Content\\Paks"); - yield return GetUnrealEngineGame("a99769d95d8f400baad1f67ab5dfe508", "\\Core\\Platform\\Content\\Paks"); - yield return GetUnrealEngineGame("Nebula", "\\BendGame\\Content"); - yield return GetUnrealEngineGame("711c5e95dc094ca58e5f16bd48e751d6", "\\MultiVersus\\Content\\Paks"); - yield return GetUnrealEngineGame("9361c8c6d2f34b42b5f2f61093eedf48", "\\TslGame\\Content\\Paks"); - yield return GetRiotGame("VALORANT", "ShooterGame\\Content\\Paks"); - yield return new DetectedGame { GameName = "Valorant [LIVE]", GameDirectory = Constants._VAL_LIVE_TRIGGER }; - yield return GetMojangGame("MinecraftDungeons", "\\dungeons\\dungeons\\Dungeons\\Content\\Paks"); - yield return GetSteamGame(381210, "\\DeadByDaylight\\Content\\Paks"); // Dead By Daylight - yield return GetSteamGame(578080, "\\TslGame\\Content\\Paks"); // PUBG - yield return GetSteamGame(1172380, "\\SwGame\\Content\\Paks"); // STAR WARS Jedi: Fallen Order™ - yield return GetSteamGame(677620, "\\PortalWars\\Content\\Paks"); // Splitgate - yield return GetSteamGame(1172620, "\\Athena\\Content\\Paks"); // Sea of Thieves - yield return GetSteamGame(1665460, "\\pak"); // eFootball 2023 - yield return GetRockstarGamesGame("GTA III - Definitive Edition", "\\Gameface\\Content\\Paks"); - yield return GetRockstarGamesGame("GTA San Andreas - Definitive Edition", "\\Gameface\\Content\\Paks"); - yield return GetRockstarGamesGame("GTA Vice City - Definitive Edition", "\\Gameface\\Content\\Paks"); - yield return GetLevelInfiniteGame("tof_launcher", "\\Hotta\\Content\\Paks"); + yield return GetUnrealEngineGame("Fortnite", "\\FortniteGame\\Content\\Paks", EGame.GAME_UE5_2); + yield return new DetectedGame { GameName = "Fortnite [LIVE]", GameDirectory = Constants._FN_LIVE_TRIGGER, OverridedGame = EGame.GAME_UE5_2 }; + yield return GetUnrealEngineGame("Pewee", "\\RogueCompany\\Content\\Paks", EGame.GAME_RogueCompany); + yield return GetUnrealEngineGame("Rosemallow", "\\Indiana\\Content\\Paks", EGame.GAME_UE4_21); + yield return GetUnrealEngineGame("Catnip", "\\OakGame\\Content\\Paks", EGame.GAME_Borderlands3); + yield return GetUnrealEngineGame("AzaleaAlpha", "\\Prospect\\Content\\Paks", EGame.GAME_UE4_27); + yield return GetUnrealEngineGame("shoebill", "\\SwGame\\Content\\Paks", EGame.GAME_StarWarsJediFallenOrder); + yield return GetUnrealEngineGame("Snoek", "\\StateOfDecay2\\Content\\Paks", EGame.GAME_StateOfDecay2); + yield return GetUnrealEngineGame("711c5e95dc094ca58e5f16bd48e751d6", "\\MultiVersus\\Content\\Paks", EGame.GAME_UE4_26); + yield return GetUnrealEngineGame("9361c8c6d2f34b42b5f2f61093eedf48", "\\TslGame\\Content\\Paks", EGame.GAME_PlayerUnknownsBattlegrounds); + yield return GetRiotGame("VALORANT", "ShooterGame\\Content\\Paks", EGame.GAME_Valorant); + yield return new DetectedGame { GameName = "Valorant [LIVE]", GameDirectory = Constants._VAL_LIVE_TRIGGER, OverridedGame = EGame.GAME_Valorant }; + yield return GetSteamGame(381210, "\\DeadByDaylight\\Content\\Paks", EGame.GAME_UE4_27); // Dead By Daylight + yield return GetSteamGame(578080, "\\TslGame\\Content\\Paks", EGame.GAME_PlayerUnknownsBattlegrounds); // PUBG + yield return GetSteamGame(1172380, "\\SwGame\\Content\\Paks", EGame.GAME_StarWarsJediFallenOrder); // STAR WARS Jedi: Fallen Order™ + yield return GetSteamGame(677620, "\\PortalWars\\Content\\Paks", EGame.GAME_Splitgate); // Splitgate + yield return GetSteamGame(1172620, "\\Athena\\Content\\Paks", EGame.GAME_SeaOfThieves); // Sea of Thieves + yield return GetSteamGame(1665460, "\\pak", EGame.GAME_UE4_26); // eFootball 2023 + yield return GetRockstarGamesGame("GTA III - Definitive Edition", "\\Gameface\\Content\\Paks", EGame.GAME_GTATheTrilogyDefinitiveEdition); + yield return GetRockstarGamesGame("GTA San Andreas - Definitive Edition", "\\Gameface\\Content\\Paks", EGame.GAME_GTATheTrilogyDefinitiveEdition); + yield return GetRockstarGamesGame("GTA Vice City - Definitive Edition", "\\Gameface\\Content\\Paks", EGame.GAME_GTATheTrilogyDefinitiveEdition); + yield return GetLevelInfiniteGame("tof_launcher", "\\Hotta\\Content\\Paks", EGame.GAME_TowerOfFantasy); } private LauncherInstalled _launcherInstalled; - private DetectedGame GetUnrealEngineGame(string gameName, string pakDirectory) + private DetectedGame GetUnrealEngineGame(string gameName, string pakDirectory, EGame version) { _launcherInstalled ??= GetDriveLauncherInstalls("ProgramData\\Epic\\UnrealEngineLauncher\\LauncherInstalled.dat"); if (_launcherInstalled?.InstallationList != null) @@ -140,7 +140,7 @@ public class GameSelectorViewModel : ViewModel if (installationList.AppName.Equals(gameName, StringComparison.OrdinalIgnoreCase) && Directory.Exists(gameDir)) { Log.Debug("Found {GameName} in LauncherInstalled.dat", gameName); - return new DetectedGame { GameName = installationList.AppName, GameDirectory = gameDir }; + return new DetectedGame { GameName = installationList.AppName, GameDirectory = gameDir, OverridedGame = version }; } } } @@ -149,7 +149,7 @@ public class GameSelectorViewModel : ViewModel } private RiotClientInstalls _riotClientInstalls; - private DetectedGame GetRiotGame(string gameName, string pakDirectory) + private DetectedGame GetRiotGame(string gameName, string pakDirectory, EGame version) { _riotClientInstalls ??= GetDriveLauncherInstalls("ProgramData\\Riot Games\\RiotClientInstalls.json"); if (_riotClientInstalls is { AssociatedClient: { } }) @@ -160,7 +160,7 @@ public class GameSelectorViewModel : ViewModel if (key.Contains(gameName, StringComparison.OrdinalIgnoreCase) && Directory.Exists(gameDir)) { Log.Debug("Found {GameName} in RiotClientInstalls.json", gameName); - return new DetectedGame { GameName = gameName, GameDirectory = gameDir }; + return new DetectedGame { GameName = gameName, GameDirectory = gameDir, OverridedGame = version }; } } } @@ -169,7 +169,7 @@ public class GameSelectorViewModel : ViewModel } private LauncherSettings _launcherSettings; - private DetectedGame GetMojangGame(string gameName, string pakDirectory) + private DetectedGame GetMojangGame(string gameName, string pakDirectory, EGame version) { _launcherSettings ??= GetDataLauncherInstalls("\\.minecraft\\launcher_settings.json"); if (_launcherSettings is { ProductLibraryDir: { } }) @@ -178,26 +178,26 @@ public class GameSelectorViewModel : ViewModel if (Directory.Exists(gameDir)) { Log.Debug("Found {GameName} in launcher_settings.json", gameName); - return new DetectedGame { GameName = gameName, GameDirectory = gameDir }; + return new DetectedGame { GameName = gameName, GameDirectory = gameDir, OverridedGame = version }; } } return null; } - private DetectedGame GetSteamGame(int id, string pakDirectory) + private DetectedGame GetSteamGame(int id, string pakDirectory, EGame version) { var steamInfo = SteamDetection.GetSteamGameById(id); if (steamInfo is not null) { Log.Debug("Found {GameName} in steam manifests", steamInfo.Name); - return new DetectedGame { GameName = steamInfo.Name, GameDirectory = $"{steamInfo.GameRoot}{pakDirectory}" }; + return new DetectedGame { GameName = steamInfo.Name, GameDirectory = $"{steamInfo.GameRoot}{pakDirectory}", OverridedGame = version }; } return null; } - private DetectedGame GetRockstarGamesGame(string key, string pakDirectory) + private DetectedGame GetRockstarGamesGame(string key, string pakDirectory, EGame version) { var installLocation = string.Empty; try @@ -213,13 +213,13 @@ public class GameSelectorViewModel : ViewModel if (Directory.Exists(gameDir)) { Log.Debug("Found {GameName} in the registry", key); - return new DetectedGame { GameName = key, GameDirectory = gameDir }; + return new DetectedGame { GameName = key, GameDirectory = gameDir, OverridedGame = version }; } return null; } - private DetectedGame GetLevelInfiniteGame(string key, string pakDirectory) + private DetectedGame GetLevelInfiniteGame(string key, string pakDirectory, EGame version) { var installLocation = string.Empty; var displayName = string.Empty; @@ -238,7 +238,7 @@ public class GameSelectorViewModel : ViewModel if (Directory.Exists(gameDir)) { Log.Debug("Found {GameName} in the registry", key); - return new DetectedGame { GameName = displayName, GameDirectory = gameDir }; + return new DetectedGame { GameName = displayName, GameDirectory = gameDir, OverridedGame = version }; } return null; diff --git a/FModel/Views/DirectorySelector.xaml b/FModel/Views/DirectorySelector.xaml index c92476b3..eac9184b 100644 --- a/FModel/Views/DirectorySelector.xaml +++ b/FModel/Views/DirectorySelector.xaml @@ -37,14 +37,21 @@ Padding="{adonisUi:Space 0}" Background="Transparent"> + + + + + + + - - + @@ -52,21 +59,23 @@ - - - - - - - - - - diff --git a/FModel/Views/DirectorySelector.xaml b/FModel/Views/DirectorySelector.xaml index eac9184b..b54fc840 100644 --- a/FModel/Views/DirectorySelector.xaml +++ b/FModel/Views/DirectorySelector.xaml @@ -51,8 +51,8 @@ - + @@ -61,8 +61,8 @@ - + @@ -71,11 +71,11 @@ - +