This commit is contained in:
4sval 2022-11-01 14:09:06 +01:00
parent 525718d35c
commit 3e41fba8b0
4 changed files with 39 additions and 8 deletions

@ -1 +1 @@
Subproject commit d2efb39f5fdc9bfbdae47cd7138601ecb0ef6812
Subproject commit c33075abbeb030c0a7d6fc12ea0913c982232e64

View File

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

View File

@ -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<FGame, string> 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<FGame, EGame> 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<FGame, List<FCustomVersion>> 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<FGame, Dictionary<string, bool>> 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<FGame, FEndpoint[]> CustomEndpoints
{
@ -482,6 +487,7 @@ namespace FModel.Settings
{FGame.Gameface, new List<CustomDirectory>()},
{FGame.Athena, new List<CustomDirectory>()},
{FGame.PandaGame, new List<CustomDirectory>()},
{FGame.Hotta, new List<CustomDirectory>()}
};
public IDictionary<FGame, IList<CustomDirectory>> CustomDirectories
{

View File

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