diff --git a/CUE4Parse b/CUE4Parse index 5bf07f46..7e02835b 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 5bf07f46d0a5c57eaeeb06d4afe749e11295eb69 +Subproject commit 7e02835b78da05956ad8b82f4326ecea77065255 diff --git a/FModel/App.xaml.cs b/FModel/App.xaml.cs index 7c485483..16ad94dc 100644 --- a/FModel/App.xaml.cs +++ b/FModel/App.xaml.cs @@ -25,7 +25,7 @@ namespace FModel { [DllImport("kernel32.dll")] private static extern bool AttachConsole(int dwProcessId); - + protected override void OnStartup(StartupEventArgs e) { #if DEBUG @@ -98,7 +98,7 @@ namespace FModel { if ((EErrorKind) messageBox.ButtonPressed.Id == EErrorKind.ResetSettings) UserSettings.Default = new UserSettings(); - + ApplicationService.ApplicationView.Restart(); } @@ -123,7 +123,7 @@ namespace FModel return $"{productName} ({(Environment.Is64BitOperatingSystem ? "64" : "32")}-bit)"; } - private string GetRegistryValue(string path, string name = null, RegistryHive root = RegistryHive.CurrentUser) + public static string GetRegistryValue(string path, string name = null, RegistryHive root = RegistryHive.CurrentUser) { using var rk = RegistryKey.OpenBaseKey(root, RegistryView.Default).OpenSubKey(path); if (rk != null) @@ -131,4 +131,4 @@ namespace FModel return string.Empty; } } -} \ No newline at end of file +} diff --git a/FModel/Enums.cs b/FModel/Enums.cs index 8dd1d82a..2e63af22 100644 --- a/FModel/Enums.cs +++ b/FModel/Enums.cs @@ -86,7 +86,9 @@ namespace FModel [Description("PLAYERUNKNOWN'S BATTLEGROUNDS")] TslGame, [Description("Splitgate")] - PortalWars + PortalWars, + [Description("GTA: The Trilogy - Definitive Edition")] + Gameface } public enum ELoadingMode diff --git a/FModel/Settings/UserSettings.cs b/FModel/Settings/UserSettings.cs index 83298e49..de6fd2b4 100644 --- a/FModel/Settings/UserSettings.cs +++ b/FModel/Settings/UserSettings.cs @@ -230,7 +230,8 @@ namespace FModel.Settings {FGame.Platform, Constants._NO_PRESET_TRIGGER}, {FGame.BendGame, Constants._NO_PRESET_TRIGGER}, {FGame.TslGame, Constants._NO_PRESET_TRIGGER}, - {FGame.PortalWars, Constants._NO_PRESET_TRIGGER} + {FGame.PortalWars, Constants._NO_PRESET_TRIGGER}, + {FGame.Gameface, Constants._NO_PRESET_TRIGGER} }; public IDictionary Presets { @@ -257,6 +258,7 @@ namespace FModel.Settings {FGame.BendGame, EGame.GAME_UE4_11}, {FGame.TslGame, EGame.GAME_PlayerUnknownsBattlegrounds}, {FGame.PortalWars, EGame.GAME_UE4_LATEST}, + {FGame.Gameface, EGame.GAME_GTATheTrilogyDefinitiveEdition} }; public IDictionary OverridedGame { @@ -282,7 +284,8 @@ namespace FModel.Settings {FGame.Platform, UE4Version.VER_UE4_DETERMINE_BY_GAME}, {FGame.BendGame, UE4Version.VER_UE4_DETERMINE_BY_GAME}, {FGame.TslGame, UE4Version.VER_UE4_DETERMINE_BY_GAME}, - {FGame.PortalWars, UE4Version.VER_UE4_DETERMINE_BY_GAME} + {FGame.PortalWars, UE4Version.VER_UE4_DETERMINE_BY_GAME}, + {FGame.Gameface, UE4Version.VER_UE4_DETERMINE_BY_GAME} }; public IDictionary OverridedUEVersion { @@ -308,7 +311,8 @@ namespace FModel.Settings {FGame.Platform, null}, {FGame.BendGame, null}, {FGame.TslGame, null}, - {FGame.PortalWars, null} + {FGame.PortalWars, null}, + {FGame.Gameface, null} }; public IDictionary> OverridedCustomVersions { @@ -334,7 +338,8 @@ namespace FModel.Settings {FGame.Platform, null}, {FGame.BendGame, null}, {FGame.TslGame, null}, - {FGame.PortalWars, null} + {FGame.PortalWars, null}, + {FGame.Gameface, null} }; public IDictionary> OverridedOptions { @@ -399,7 +404,8 @@ namespace FModel.Settings {FGame.Platform, new List()}, {FGame.BendGame, new List()}, {FGame.TslGame, new List()}, - {FGame.PortalWars, new List()} + {FGame.PortalWars, new List()}, + {FGame.Gameface, new List()} }; public IDictionary> CustomDirectories { diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 5d6de9db..c1cd8947 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -614,7 +614,7 @@ namespace FModel.ViewModels default: { FLogger.AppendWarning(); - FLogger.AppendText($"The file '{fileName}' is of an unknown type. If this is a mistake, we are already working to fix it!", Constants.WHITE, true); + FLogger.AppendText($"The file '{fileName}' is of an unknown type.", Constants.WHITE, true); break; } } diff --git a/FModel/ViewModels/GameSelectorViewModel.cs b/FModel/ViewModels/GameSelectorViewModel.cs index 0a4980c1..a3fd0d4a 100644 --- a/FModel/ViewModels/GameSelectorViewModel.cs +++ b/FModel/ViewModels/GameSelectorViewModel.cs @@ -68,6 +68,9 @@ namespace FModel.ViewModels yield return GetMojangGame("MinecraftDungeons", "\\dungeons\\dungeons\\Dungeons\\Content\\Paks"); yield return GetSteamGame(578080, "\\TslGame\\Content\\Paks"); // PUBG yield return GetSteamGame(677620, "\\PortalWars\\Content\\Paks"); // Splitgate + 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"); } private LauncherInstalled _launcherInstalled; @@ -125,6 +128,25 @@ namespace FModel.ViewModels return null; } + private DetectedGame GetRockstarGamesGame(string key, string pakDirectory) + { + var installLocation = string.Empty; + try + { + installLocation = App.GetRegistryValue(@$"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{key}", "InstallLocation", RegistryHive.LocalMachine); + } + catch + { + // ignored + } + + if (!string.IsNullOrEmpty(installLocation)) + return new DetectedGame { GameName = key, GameDirectory = $"{installLocation}{pakDirectory}" }; + + Log.Warning("Could not find {GameName} in the registry", key); + return null; + } + private T GetDriveLauncherInstalls(string jsonFile) { foreach (var drive in DriveInfo.GetDrives())