From 3e41fba8b08f5934319db0736718a8915db9c91b Mon Sep 17 00:00:00 2001 From: 4sval Date: Tue, 1 Nov 2022 14:09:06 +0100 Subject: [PATCH] bump --- CUE4Parse | 2 +- FModel/Enums.cs | 4 +++- FModel/Settings/UserSettings.cs | 18 +++++++++++------ FModel/ViewModels/GameSelectorViewModel.cs | 23 ++++++++++++++++++++++ 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/CUE4Parse b/CUE4Parse index d2efb39f..c33075ab 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit d2efb39f5fdc9bfbdae47cd7138601ecb0ef6812 +Subproject commit c33075abbeb030c0a7d6fc12ea0913c982232e64 diff --git a/FModel/Enums.cs b/FModel/Enums.cs index d8d12490..111801b9 100644 --- a/FModel/Enums.cs +++ b/FModel/Enums.cs @@ -92,7 +92,9 @@ public enum FGame [Description("Sea of Thieves")] Athena, [Description("Your Beloved ™ Panda")] - PandaGame + PandaGame, + [Description("Tower of Fantasy")] + Hotta } public enum ELoadingMode diff --git a/FModel/Settings/UserSettings.cs b/FModel/Settings/UserSettings.cs index 1689364d..61e4f815 100644 --- a/FModel/Settings/UserSettings.cs +++ b/FModel/Settings/UserSettings.cs @@ -140,7 +140,7 @@ namespace FModel.Settings set => SetProperty(ref _isLoggerExpanded, value); } - private GridLength _avalonImageSize = new (200, GridUnitType.Pixel); + private GridLength _avalonImageSize = new (200); public GridLength AvalonImageSize { get => _avalonImageSize; @@ -283,7 +283,8 @@ namespace FModel.Settings {FGame.PortalWars, Constants._NO_PRESET_TRIGGER}, {FGame.Gameface, Constants._NO_PRESET_TRIGGER}, {FGame.Athena, Constants._NO_PRESET_TRIGGER}, - {FGame.PandaGame, Constants._NO_PRESET_TRIGGER} + {FGame.PandaGame, Constants._NO_PRESET_TRIGGER}, + {FGame.Hotta, Constants._NO_PRESET_TRIGGER} }; public IDictionary Presets { @@ -312,7 +313,8 @@ namespace FModel.Settings {FGame.PortalWars, EGame.GAME_UE4_LATEST}, {FGame.Gameface, EGame.GAME_GTATheTrilogyDefinitiveEdition}, {FGame.Athena, EGame.GAME_SeaOfThieves}, - {FGame.PandaGame, EGame.GAME_UE4_26} + {FGame.PandaGame, EGame.GAME_UE4_26}, + {FGame.Hotta, EGame.GAME_TowerOfFantasy} }; public IDictionary OverridedGame { @@ -341,7 +343,8 @@ namespace FModel.Settings {FGame.PortalWars, null}, {FGame.Gameface, null}, {FGame.Athena, null}, - {FGame.PandaGame, null} + {FGame.PandaGame, null}, + {FGame.Hotta, null} }; public IDictionary> OverridedCustomVersions { @@ -370,7 +373,8 @@ namespace FModel.Settings {FGame.PortalWars, null}, {FGame.Gameface, null}, {FGame.Athena, null}, - {FGame.PandaGame, null} + {FGame.PandaGame, null}, + {FGame.Hotta, null} }; public IDictionary> OverridedOptions { @@ -405,7 +409,8 @@ namespace FModel.Settings {FGame.PortalWars, new FEndpoint[]{new (), new ()}}, {FGame.Gameface, new FEndpoint[]{new (), new ()}}, {FGame.Athena, new FEndpoint[]{new (), new ()}}, - {FGame.PandaGame, new FEndpoint[]{new (), new ()}} + {FGame.PandaGame, new FEndpoint[]{new (), new ()}}, + {FGame.Hotta, new FEndpoint[]{new (), new ()}} }; public IDictionary CustomEndpoints { @@ -482,6 +487,7 @@ namespace FModel.Settings {FGame.Gameface, new List()}, {FGame.Athena, new List()}, {FGame.PandaGame, new List()}, + {FGame.Hotta, new List()} }; public IDictionary> CustomDirectories { diff --git a/FModel/ViewModels/GameSelectorViewModel.cs b/FModel/ViewModels/GameSelectorViewModel.cs index 569d0c46..d765630d 100644 --- a/FModel/ViewModels/GameSelectorViewModel.cs +++ b/FModel/ViewModels/GameSelectorViewModel.cs @@ -120,6 +120,7 @@ public class GameSelectorViewModel : ViewModel 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"); } private LauncherInstalled _launcherInstalled; @@ -199,6 +200,28 @@ public class GameSelectorViewModel : ViewModel return null; } + private DetectedGame GetLevelInfiniteGame(string key, string pakDirectory) + { + var installLocation = string.Empty; + var displayName = string.Empty; + + try + { + installLocation = App.GetRegistryValue($@"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{key}", "GameInstallPath", RegistryHive.CurrentUser); + displayName = App.GetRegistryValue($@"Software\Microsoft\Windows\CurrentVersion\Uninstall\{key}", "DisplayName", RegistryHive.CurrentUser); + } + catch + { + // ignored + } + + if (!string.IsNullOrEmpty(installLocation)) + return new DetectedGame { GameName = displayName, 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())