support for "GTA: The Trilogy - Definitive Edition"

This commit is contained in:
iAmAsval 2021-11-13 16:03:33 +01:00
parent 8b23abd271
commit 6c5a83409b
6 changed files with 42 additions and 12 deletions

@ -1 +1 @@
Subproject commit 5bf07f46d0a5c57eaeeb06d4afe749e11295eb69
Subproject commit 7e02835b78da05956ad8b82f4326ecea77065255

View File

@ -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;
}
}
}
}

View File

@ -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

View File

@ -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<FGame, string> 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<FGame, EGame> 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<FGame, UE4Version> 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<FGame, List<FCustomVersion>> 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<FGame, Dictionary<string, bool>> OverridedOptions
{
@ -399,7 +404,8 @@ namespace FModel.Settings
{FGame.Platform, new List<CustomDirectory>()},
{FGame.BendGame, new List<CustomDirectory>()},
{FGame.TslGame, new List<CustomDirectory>()},
{FGame.PortalWars, new List<CustomDirectory>()}
{FGame.PortalWars, new List<CustomDirectory>()},
{FGame.Gameface, new List<CustomDirectory>()}
};
public IDictionary<FGame, IList<CustomDirectory>> CustomDirectories
{

View File

@ -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;
}
}

View File

@ -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<T>(string jsonFile)
{
foreach (var drive in DriveInfo.GetDrives())