From cfa8eeea6c1399854ab20ecff08f3d58592d18d1 Mon Sep 17 00:00:00 2001 From: 4sval Date: Sun, 4 Jun 2023 18:18:37 +0200 Subject: [PATCH 01/42] build --- CUE4Parse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CUE4Parse b/CUE4Parse index 2cdf9d61..a5aa9a75 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 2cdf9d61e66253f746f6a6e5b23b57979fbaab69 +Subproject commit a5aa9a7551440ce4cd9a0147dbf8757701cae23c From 6dce30b33fac3114846dc78213faab815489357c Mon Sep 17 00:00:00 2001 From: 4sval Date: Sun, 4 Jun 2023 20:09:48 +0200 Subject: [PATCH 02/42] you back --- FModel/ViewModels/CUE4ParseViewModel.cs | 6 +++--- FModel/ViewModels/Commands/MenuCommand.cs | 4 ++-- FModel/ViewModels/Commands/RightClickMenuCommand.cs | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 16f2c2b8..2bca8b90 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -609,7 +609,7 @@ public class CUE4ParseViewModel : ViewModel { foreach (var asset in assetItems) { - Thread.Sleep(10); + Thread.Yield(); cancellationToken.ThrowIfCancellationRequested(); Extract(cancellationToken, asset.FullPath, TabControl.HasNoTabs); } @@ -619,7 +619,7 @@ public class CUE4ParseViewModel : ViewModel { foreach (var asset in folder.AssetsList.Assets) { - Thread.Sleep(10); + Thread.Yield(); cancellationToken.ThrowIfCancellationRequested(); try { @@ -892,7 +892,7 @@ public class CUE4ParseViewModel : ViewModel TabControl.SelectedTab.SetDocumentText(verseDigest.ReadableCode, false, false); return true; } - case UTexture2D { IsVirtual: false } texture when isNone: + case UTexture2D { IsVirtual: false } texture when isNone || saveTextures: { TabControl.SelectedTab.AddImage(texture, saveTextures, updateUi); return false; diff --git a/FModel/ViewModels/Commands/MenuCommand.cs b/FModel/ViewModels/Commands/MenuCommand.cs index 89d870a6..f61dc8df 100644 --- a/FModel/ViewModels/Commands/MenuCommand.cs +++ b/FModel/ViewModels/Commands/MenuCommand.cs @@ -111,7 +111,7 @@ public class MenuCommand : ViewModelCommand if (!expand && folder.IsExpanded) { folder.IsExpanded = false; - Thread.Sleep(10); + Thread.Yield(); cancellationToken.ThrowIfCancellationRequested(); } @@ -129,7 +129,7 @@ public class MenuCommand : ViewModelCommand for (var node = nodes.Last; node != null; node = node.Previous) { node.Value.IsExpanded = true; - Thread.Sleep(10); + Thread.Yield(); cancellationToken.ThrowIfCancellationRequested(); } } diff --git a/FModel/ViewModels/Commands/RightClickMenuCommand.cs b/FModel/ViewModels/Commands/RightClickMenuCommand.cs index 1da8395e..ab009a4b 100644 --- a/FModel/ViewModels/Commands/RightClickMenuCommand.cs +++ b/FModel/ViewModels/Commands/RightClickMenuCommand.cs @@ -29,7 +29,7 @@ public class RightClickMenuCommand : ViewModelCommand case "Assets_Extract_New_Tab": foreach (var asset in assetItems) { - Thread.Sleep(10); + Thread.Yield(); cancellationToken.ThrowIfCancellationRequested(); contextViewModel.CUE4Parse.Extract(cancellationToken, asset.FullPath, true); } @@ -37,7 +37,7 @@ public class RightClickMenuCommand : ViewModelCommand case "Assets_Export_Data": foreach (var asset in assetItems) { - Thread.Sleep(10); + Thread.Yield(); cancellationToken.ThrowIfCancellationRequested(); contextViewModel.CUE4Parse.ExportData(asset.FullPath); } @@ -45,7 +45,7 @@ public class RightClickMenuCommand : ViewModelCommand case "Assets_Save_Properties": foreach (var asset in assetItems) { - Thread.Sleep(10); + Thread.Yield(); cancellationToken.ThrowIfCancellationRequested(); contextViewModel.CUE4Parse.Extract(cancellationToken, asset.FullPath, false, EBulkType.Properties); } @@ -53,7 +53,7 @@ public class RightClickMenuCommand : ViewModelCommand case "Assets_Save_Textures": foreach (var asset in assetItems) { - Thread.Sleep(10); + Thread.Yield(); cancellationToken.ThrowIfCancellationRequested(); contextViewModel.CUE4Parse.Extract(cancellationToken, asset.FullPath, false, EBulkType.Textures); } @@ -61,7 +61,7 @@ public class RightClickMenuCommand : ViewModelCommand case "Assets_Save_Models": foreach (var asset in assetItems) { - Thread.Sleep(10); + Thread.Yield(); cancellationToken.ThrowIfCancellationRequested(); contextViewModel.CUE4Parse.Extract(cancellationToken, asset.FullPath, false, EBulkType.Meshes | EBulkType.Auto); } @@ -69,7 +69,7 @@ public class RightClickMenuCommand : ViewModelCommand case "Assets_Save_Animations": foreach (var asset in assetItems) { - Thread.Sleep(10); + Thread.Yield(); cancellationToken.ThrowIfCancellationRequested(); contextViewModel.CUE4Parse.Extract(cancellationToken, asset.FullPath, false, EBulkType.Animations | EBulkType.Auto); } From 84f5d4d6053cc6ed389b6fdc073f77fab55d8797 Mon Sep 17 00:00:00 2001 From: GMatrixGames Date: Mon, 5 Jun 2023 17:39:52 -0400 Subject: [PATCH 03/42] Fixes for texture refactor --- CUE4Parse | 2 +- FModel/ViewModels/CUE4ParseViewModel.cs | 4 ++-- FModel/ViewModels/TabControlViewModel.cs | 4 ++-- FModel/Views/Snooper/Models/Model.cs | 8 ++++---- FModel/Views/Snooper/Options.cs | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CUE4Parse b/CUE4Parse index a5aa9a75..5b38fc68 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit a5aa9a7551440ce4cd9a0147dbf8757701cae23c +Subproject commit 5b38fc685da2f574262d54639f687945660cdf00 diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 2bca8b90..a387e007 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -759,7 +759,7 @@ public class CUE4ParseViewModel : ViewModel break; } - case "bin" when fileName.Contains("AssetRegistry"): + case "bin" when fileName.Contains("AssetRegistry", StringComparison.OrdinalIgnoreCase): { if (Provider.TryCreateReader(fullPath, out var archive)) { @@ -892,7 +892,7 @@ public class CUE4ParseViewModel : ViewModel TabControl.SelectedTab.SetDocumentText(verseDigest.ReadableCode, false, false); return true; } - case UTexture2D { IsVirtual: false } texture when isNone || saveTextures: + case UTexture { IsVirtual: false } texture when isNone || saveTextures: { TabControl.SelectedTab.AddImage(texture, saveTextures, updateUi); return false; diff --git a/FModel/ViewModels/TabControlViewModel.cs b/FModel/ViewModels/TabControlViewModel.cs index 064ed0cc..3e603eb0 100644 --- a/FModel/ViewModels/TabControlViewModel.cs +++ b/FModel/ViewModels/TabControlViewModel.cs @@ -228,8 +228,8 @@ public class TabItem : ViewModel }); } - public void AddImage(UTexture2D texture, bool save, bool updateUi) - => AddImage(texture.Name, texture.bRenderNearestNeighbor, texture.Decode(UserSettings.Default.OverridedPlatform), save, updateUi); + public void AddImage(UTexture texture, bool save, bool updateUi) + => AddImage(texture.Name, texture.RenderNearestNeighbor, texture.Decode(UserSettings.Default.OverridedPlatform), save, updateUi); public void AddImage(string name, bool rnn, SKBitmap[] img, bool save, bool updateUi) { diff --git a/FModel/Views/Snooper/Models/Model.cs b/FModel/Views/Snooper/Models/Model.cs index fd04527b..1bbdf26e 100644 --- a/FModel/Views/Snooper/Models/Model.cs +++ b/FModel/Views/Snooper/Models/Model.cs @@ -440,10 +440,10 @@ public class Model : IDisposable public void Dispose() { - _ebo.Dispose(); - _vbo.Dispose(); - _matrixVbo.Dispose(); - _vao.Dispose(); + _ebo?.Dispose(); + _vbo?.Dispose(); + _matrixVbo?.Dispose(); + _vao?.Dispose(); Skeleton?.Dispose(); for (int socket = 0; socket < Sockets.Count; socket++) { diff --git a/FModel/Views/Snooper/Options.cs b/FModel/Views/Snooper/Options.cs index 56b49c3c..59968359 100644 --- a/FModel/Views/Snooper/Options.cs +++ b/FModel/Views/Snooper/Options.cs @@ -182,7 +182,7 @@ public class Options var guid = o.LightingGuid; if (!Textures.TryGetValue(guid, out texture) && o.GetMipByMaxSize(UserSettings.Default.PreviewMaxTextureSize) is { } mip) { - TextureDecoder.DecodeTexture(mip, o.Format, o.isNormalMap, _platform, out var data, out _); + TextureDecoder.DecodeTexture(mip, o.Format, o.IsNormalMap, _platform, out var data, out _); texture = new Texture(data, mip.SizeX, mip.SizeY, o); if (fix) TextureHelper.FixChannels(_game, texture); From d4e2bf187f42fb0d835830963e88ba7cb22a777a Mon Sep 17 00:00:00 2001 From: 4sval Date: Fri, 9 Jun 2023 21:19:37 +0200 Subject: [PATCH 04/42] SwizzleRoughnessToGreen --- CUE4Parse | 2 +- FModel/ViewModels/CUE4ParseViewModel.cs | 14 ++++++++------ FModel/Views/Snooper/Shading/Material.cs | 15 +++++++++++++++ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CUE4Parse b/CUE4Parse index 5b38fc68..f3ad3b30 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 5b38fc685da2f574262d54639f687945660cdf00 +Subproject commit f3ad3b3093f2693604415fa94ce9a53bb5a5c3fa diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index a387e007..862138b9 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -393,11 +393,10 @@ public class CUE4ParseViewModel : ViewModel return Task.Run(() => { + var l = ELog.Information; if (endpoint.Overwrite && File.Exists(endpoint.FilePath)) { Provider.MappingsContainer = new FileUsmapTypeMappingsProvider(endpoint.FilePath); - FLogger.Append(ELog.Information, () => - FLogger.Text($"Mappings pulled from '{endpoint.FilePath.SubstringAfterLast("\\")}'", Constants.WHITE, true)); } else if (endpoint.IsValid) { @@ -416,8 +415,6 @@ public class CUE4ParseViewModel : ViewModel } Provider.MappingsContainer = new FileUsmapTypeMappingsProvider(mappingPath); - FLogger.Append(ELog.Information, () => - FLogger.Text($"Mappings pulled from '{mapping.FileName}'", Constants.WHITE, true)); break; } } @@ -429,10 +426,15 @@ public class CUE4ParseViewModel : ViewModel var latestUsmapInfo = latestUsmaps.OrderBy(f => f.LastWriteTime).Last(); Provider.MappingsContainer = new FileUsmapTypeMappingsProvider(latestUsmapInfo.FullName); - FLogger.Append(ELog.Warning, () => - FLogger.Text($"Mappings pulled from '{latestUsmapInfo.Name}'", Constants.WHITE, true)); + l = ELog.Warning; } } + + if (Provider.MappingsContainer is FileUsmapTypeMappingsProvider m) + { + Log.Information($"Mappings pulled from '{m.FileName}'"); + FLogger.Append(l, () => FLogger.Text($"Mappings pulled from '{m.FileName}'", Constants.WHITE, true)); + } }); } diff --git a/FModel/Views/Snooper/Shading/Material.cs b/FModel/Views/Snooper/Shading/Material.cs index fed91051..7fd0ca9d 100644 --- a/FModel/Views/Snooper/Shading/Material.cs +++ b/FModel/Views/Snooper/Shading/Material.cs @@ -132,6 +132,21 @@ public class Material : IDisposable "Emissive 2 UV Positioning (RG)UpperLeft (BA)LowerRight", "EmissiveUVPositioning (RG)UpperLeft (BA)LowerRight")) EmissiveRegion = new Vector4(EmissiveUVs.R, EmissiveUVs.G, EmissiveUVs.B, EmissiveUVs.A); + + if (Parameters.TryGetSwitch(out var swizzleRoughnessToGreen, "SwizzleRoughnessToGreen") && swizzleRoughnessToGreen) + { + foreach (var specMask in SpecularMasks) + { + specMask.SwizzleMask = new [] + { + (int) PixelFormat.Red, + (int) PixelFormat.Blue, + (int) PixelFormat.Green, + (int) PixelFormat.Alpha + }; + specMask.Swizzle(); + } + } } } } From 6f11d870c3a9d89e4bd88d572216c65d0de86dca Mon Sep 17 00:00:00 2001 From: 4sval Date: Fri, 9 Jun 2023 21:49:21 +0200 Subject: [PATCH 05/42] FModel v4.4.3.2 --- FModel/FModel.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FModel/FModel.csproj b/FModel/FModel.csproj index ded384a9..7f2f84df 100644 --- a/FModel/FModel.csproj +++ b/FModel/FModel.csproj @@ -5,9 +5,9 @@ net6.0-windows true FModel.ico - 4.4.3.1 - 4.4.3.1 - 4.4.3.1 + 4.4.3.2 + 4.4.3.2 + 4.4.3.2 false true win-x64 From 3435897e994fef056190d5a35fe19c911138df97 Mon Sep 17 00:00:00 2001 From: GMatrixGames Date: Sun, 11 Jun 2023 08:51:24 -0400 Subject: [PATCH 06/42] Handle KeepMobileMinLODSettingOnDesktop --- CUE4Parse | 2 +- FModel/ViewModels/CUE4ParseViewModel.cs | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/CUE4Parse b/CUE4Parse index f3ad3b30..2666e11a 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit f3ad3b3093f2693604415fa94ce9a53bb5a5c3fa +Subproject commit 2666e11af8aa93222a07ac8513f5257af51304ce diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 862138b9..265839ba 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -446,13 +446,26 @@ public class CUE4ParseViewModel : ViewModel return Task.Run(() => { - var inst = new List(); - Provider.DefaultEngine.FindPropertyInstructions("ConsoleVariables", "a.StripAdditiveRefPose", inst); - if (inst.Count > 0 && inst[0].Value.Equals("1")) + foreach (var token in Provider.DefaultEngine.Sections.FirstOrDefault(s => s.Name == "ConsoleVariables")?.Tokens ?? new List()) { - FLogger.Append(ELog.Warning, () => - FLogger.Text("Additive animations have their reference pose stripped, which will lead to inaccurate preview and export", Constants.WHITE, true)); + if (token is not InstructionToken it) continue; + var boolValue = it.Value.Equals("1"); + + switch (it.Key) + { + case "a.StripAdditiveRefPose" when boolValue: + FLogger.Append(ELog.Warning, () => + 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; + continue; + } } + _cvaVerifDone = true; }); } From a184a258ab3b806cc012e81769219e6539e45507 Mon Sep 17 00:00:00 2001 From: 4sval Date: Tue, 13 Jun 2023 23:54:09 +0200 Subject: [PATCH 07/42] 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 @@ - +