explicit ue version

This commit is contained in:
4sval
2023-06-13 23:54:09 +02:00
parent 3435897e99
commit a184a258ab
8 changed files with 73 additions and 65 deletions

View File

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

View File

@@ -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();

View File

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

View File

@@ -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<FCustomVersion> OverridedCustomVersions { get; set; }
public Dictionary<string, bool> OverridedOptions { get; set; }
public Dictionary<string, KeyValuePair<string, string>> OverridedMapStructTypes { get; set; }
@@ -42,6 +42,7 @@ public class GameSelectorViewModel : ViewModel
private readonly ObservableCollection<DetectedGame> _autoDetectedGames;
public ReadOnlyObservableCollection<DetectedGame> AutoDetectedGames { get; }
public ReadOnlyObservableCollection<EGame> 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<EGame>(new ObservableCollection<EGame>(EnumerateUeGames()));
}
/// <summary>
@@ -97,39 +100,36 @@ public class GameSelectorViewModel : ViewModel
SelectedDetectedGame = AutoDetectedGames.Last();
}
private IEnumerable<EGame> EnumerateUeGames() => Enum.GetValues<EGame>();
private IEnumerable<DetectedGame> 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<LauncherInstalled>("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<RiotClientInstalls>("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<LauncherSettings>("\\.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;

View File

@@ -37,14 +37,21 @@
Padding="{adonisUi:Space 0}" Background="Transparent">
<StackPanel>
<Grid Margin="0 5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="Detected Game" VerticalAlignment="Center" />
<ComboBox Grid.Column="2" ItemsSource="{Binding AutoDetectedGames}"
<TextBlock Grid.Row="0" Grid.Column="0" Text="Detected Game" VerticalAlignment="Center" Margin="0 0 0 5" />
<ComboBox Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="3" ItemsSource="{Binding AutoDetectedGames}" Margin="0 0 0 5"
VerticalAlignment="Center" SelectedItem="{Binding SelectedDetectedGame, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
@@ -52,21 +59,23 @@
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
<Grid x:Name="Hello" Margin="0 0 0 5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" Text="{Binding SelectedDetectedGame.GameDirectory, Mode=TwoWay}" />
<Button Grid.Column="2" Content="..." HorizontalAlignment="Right" Click="OnBrowseDirectories" />
<Button Grid.Column="3" Style="{DynamicResource {x:Static adonisUi:Styles.AccentButton}}" Padding="0"
Click="OnDeleteDirectory" Width="{Binding ActualWidth, ElementName=OkGuysButWhoFuckingAsked}"
Visibility="{Binding SelectedDetectedGame.IsManual, Converter={StaticResource BoolToVisibilityConverter}}"
ToolTip="Delete Game" Margin="5 0 0 0">
<TextBlock Grid.Row="1" Grid.Column="0" Text="UE Versions" VerticalAlignment="Center" Margin="0 0 0 5" />
<ComboBox Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="3" ItemsSource="{Binding UeGames}" Margin="0 0 0 5"
VerticalAlignment="Center" SelectedItem="{Binding SelectedDetectedGame.OverridedGame, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={x:Static converters:EnumToStringConverter.Instance}}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Grid.Row="2" Grid.Column="0" Text="Directory" VerticalAlignment="Center" />
<TextBox Grid.Row="2" Grid.Column="2" Text="{Binding SelectedDetectedGame.GameDirectory, Mode=TwoWay}" />
<Button Grid.Row="2" Grid.Column="4" Content="..." HorizontalAlignment="Right" Click="OnBrowseDirectories" />
<Button Grid.Row="2" Grid.Column="4" Style="{DynamicResource {x:Static adonisUi:Styles.AccentButton}}" Padding="0"
Click="OnDeleteDirectory" Width="{Binding ActualWidth, ElementName=OkGuysButWhoFuckingAsked}" ToolTip="Delete Game"
Visibility="{Binding SelectedDetectedGame.IsManual, Converter={StaticResource BoolToVisibilityConverter}}">
<Viewbox Width="16" Height="16" HorizontalAlignment="Center">
<Canvas Width="24" Height="24">
<Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource RemoveIcon}" />

View File

@@ -44,7 +44,7 @@ public partial class DirectorySelector
private void OnAddDirectory(object sender, RoutedEventArgs e)
{
if (DataContext is not GameSelectorViewModel gameLauncherViewModel||
if (DataContext is not GameSelectorViewModel gameLauncherViewModel ||
string.IsNullOrEmpty(HelloMyNameIsGame.Text) ||
string.IsNullOrEmpty(HelloGameMyNameIsDirectory.Text))
return;
@@ -61,4 +61,4 @@ public partial class DirectorySelector
gameLauncherViewModel.DeleteSelectedGame();
}
}
}

View File

@@ -55,7 +55,7 @@
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="Output Directory *" VerticalAlignment="Center" Margin="0 0 0 5" ToolTip="Directory where log files, backups and other do-not-delete files will be put in." />
<TextBox x:Name="ImStockBro" Grid.Row="0" Grid.Column="2" Text="{Binding OutputDirectory, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="0 0 0 5" />
<TextBox x:Name="ImJackedBro" Grid.Row="0" Grid.Column="2" Text="{Binding OutputDirectory, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="0 0 0 5" />
<Button Grid.Row="0" Grid.Column="4" Content="..." HorizontalAlignment="Right" Click="OnBrowseOutput" Margin="0 0 0 5" />
<CheckBox Grid.Row="0" Grid.Column="6" Margin="5 0 0 5" ToolTip="Customize the directory of more output folders"
@@ -73,7 +73,7 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="{Binding ActualWidth, ElementName=ImStockBro}" />
<ColumnDefinition Width="{Binding ActualWidth, ElementName=ImJackedBro}" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>