From 8a41247acbdaceb849707c0d35ba25cdf16c4cf3 Mon Sep 17 00:00:00 2001 From: GhostScissors <79089473+GhostScissors@users.noreply.github.com> Date: Mon, 2 Dec 2024 12:41:07 +0530 Subject: [PATCH 1/3] Make downloading of chunks parallel + fixes for icons --- FModel/Creator/Bases/FN/BaseCommunity.cs | 11 +++++++++++ FModel/Creator/Bases/FN/BaseIcon.cs | 1 + FModel/ViewModels/CUE4ParseViewModel.cs | 12 ++++++------ FModel/ViewModels/GameSelectorViewModel.cs | 4 ++-- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/FModel/Creator/Bases/FN/BaseCommunity.cs b/FModel/Creator/Bases/FN/BaseCommunity.cs index bd4b673c..98cb7900 100644 --- a/FModel/Creator/Bases/FN/BaseCommunity.cs +++ b/FModel/Creator/Bases/FN/BaseCommunity.cs @@ -58,6 +58,9 @@ public class BaseCommunity : BaseIcon if (Object.TryGetValue(out FGameplayTagContainer gameplayTags, "GameplayTags")) CheckGameplayTags(gameplayTags); + else if (Object.TryGetValue(out FInstancedStruct[] dataList, "DataList")) + CheckGameplayTags(dataList); + if (Object.TryGetValue(out FPackageIndex cosmeticItem, "cosmetic_item")) CosmeticSource = cosmeticItem.Name.ToUpper(); @@ -91,6 +94,14 @@ public class BaseCommunity : BaseIcon return new[] { ret }; } + private void CheckGameplayTags(FInstancedStruct[] dataList) + { + if (dataList.FirstOrDefault(d => d.NonConstStruct?.TryGetValue(out FGameplayTagContainer _, "Tags") ?? false) is { NonConstStruct: not null } tags) + { + CheckGameplayTags(tags.NonConstStruct.Get("Tags")); + } + } + private void CheckGameplayTags(FGameplayTagContainer gameplayTags) { if (_design == null) return; diff --git a/FModel/Creator/Bases/FN/BaseIcon.cs b/FModel/Creator/Bases/FN/BaseIcon.cs index d1b5971d..ab45e2c7 100644 --- a/FModel/Creator/Bases/FN/BaseIcon.cs +++ b/FModel/Creator/Bases/FN/BaseIcon.cs @@ -229,6 +229,7 @@ public class BaseIcon : UCreator 2 => 8, 3 => 4, 4 => 5, + 5 => 5, _ => 10 }; diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 11c97581..b20c3095 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -253,22 +253,22 @@ public class CUE4ParseViewModel : ViewModel ).GetAwaiter().GetResult(); var parseTime = Stopwatch.GetElapsedTime(startTs); - foreach (var fileManifest in manifest.Files) + Parallel.ForEach(manifest.Files, fileManifest => { if (fileManifest.FileName.Equals("Cloud/IoStoreOnDemand.ini", StringComparison.OrdinalIgnoreCase)) { IoStoreOnDemand.Read(new StreamReader(fileManifest.GetStream())); - continue; + return; } if (!_fnLive.IsMatch(fileManifest.FileName)) { - continue; + return; } p.RegisterVfs(fileManifest.FileName, [fileManifest.GetStream()] , it => new FRandomAccessStreamArchive(it, manifest.Files.First(x => x.FileName.Equals(it)).GetStream(), p.Versions)); - } + }); FLogger.Append(ELog.Information, () => FLogger.Text($"Fortnite [LIVE] has been loaded successfully in {parseTime.TotalMilliseconds}ms", Constants.WHITE, true)); @@ -282,10 +282,10 @@ public class CUE4ParseViewModel : ViewModel throw new Exception("Could not load latest Valorant manifest, you may have to switch to your local installation."); } - for (var i = 0; i < manifestInfo.Paks.Length; i++) + Parallel.For(0, manifestInfo.Paks.Length, i => { p.RegisterVfs(manifestInfo.Paks[i].GetFullName(), [manifestInfo.GetPakStream(i)]); - } + }); FLogger.Append(ELog.Information, () => FLogger.Text($"Valorant '{manifestInfo.Header.GameVersion}' has been loaded successfully", Constants.WHITE, true)); diff --git a/FModel/ViewModels/GameSelectorViewModel.cs b/FModel/ViewModels/GameSelectorViewModel.cs index c8bdd253..b535855d 100644 --- a/FModel/ViewModels/GameSelectorViewModel.cs +++ b/FModel/ViewModels/GameSelectorViewModel.cs @@ -87,8 +87,8 @@ public class GameSelectorViewModel : ViewModel .OrderBy(value => (int)value == ((int)value & ~0xF)); private IEnumerable EnumerateDetectedGames() { - yield return GetUnrealEngineGame("Fortnite", "\\FortniteGame\\Content\\Paks", EGame.GAME_UE5_5); - yield return DirectorySettings.Default("Fortnite [LIVE]", Constants._FN_LIVE_TRIGGER, ue: EGame.GAME_UE5_5); + yield return GetUnrealEngineGame("Fortnite", "\\FortniteGame\\Content\\Paks", EGame.GAME_UE5_6); + yield return DirectorySettings.Default("Fortnite [LIVE]", Constants._FN_LIVE_TRIGGER, ue: EGame.GAME_UE5_6); 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); From b6bba28b6d6232e6455bb826da9b65f404d5b3a4 Mon Sep 17 00:00:00 2001 From: GhostScissors <79089473+GhostScissors@users.noreply.github.com> Date: Mon, 2 Dec 2024 20:44:35 +0530 Subject: [PATCH 2/3] Made CheckGameplayTags in BaseIcon virtual and protected --- FModel/Creator/Bases/FN/BaseCommunity.cs | 10 +--------- FModel/Creator/Bases/FN/BaseIcon.cs | 5 +++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/FModel/Creator/Bases/FN/BaseCommunity.cs b/FModel/Creator/Bases/FN/BaseCommunity.cs index 98cb7900..8ac06a9d 100644 --- a/FModel/Creator/Bases/FN/BaseCommunity.cs +++ b/FModel/Creator/Bases/FN/BaseCommunity.cs @@ -94,15 +94,7 @@ public class BaseCommunity : BaseIcon return new[] { ret }; } - private void CheckGameplayTags(FInstancedStruct[] dataList) - { - if (dataList.FirstOrDefault(d => d.NonConstStruct?.TryGetValue(out FGameplayTagContainer _, "Tags") ?? false) is { NonConstStruct: not null } tags) - { - CheckGameplayTags(tags.NonConstStruct.Get("Tags")); - } - } - - private void CheckGameplayTags(FGameplayTagContainer gameplayTags) + protected override void CheckGameplayTags(FGameplayTagContainer gameplayTags) { if (_design == null) return; if (_design.DrawSource) diff --git a/FModel/Creator/Bases/FN/BaseIcon.cs b/FModel/Creator/Bases/FN/BaseIcon.cs index ab45e2c7..d8616c09 100644 --- a/FModel/Creator/Bases/FN/BaseIcon.cs +++ b/FModel/Creator/Bases/FN/BaseIcon.cs @@ -265,14 +265,15 @@ public class BaseIcon : UCreator return Utils.RemoveHtmlTags(string.Format(introduced, d)); } - private void CheckGameplayTags(FInstancedStruct[] dataList) + protected void CheckGameplayTags(FInstancedStruct[] dataList) { if (dataList.FirstOrDefault(d => d.NonConstStruct?.TryGetValue(out FGameplayTagContainer _, "Tags") ?? false) is { NonConstStruct: not null } tags) { CheckGameplayTags(tags.NonConstStruct.Get("Tags")); } } - private void CheckGameplayTags(FGameplayTagContainer gameplayTags) + + protected virtual void CheckGameplayTags(FGameplayTagContainer gameplayTags) { if (gameplayTags.TryGetGameplayTag("Cosmetics.Source.", out var source)) CosmeticSource = source.Text["Cosmetics.Source.".Length..]; From f341bb53ad58a91aaa3d77a81b741783851f74ee Mon Sep 17 00:00:00 2001 From: GhostScissors <79089473+GhostScissors@users.noreply.github.com> Date: Mon, 2 Dec 2024 22:40:35 +0530 Subject: [PATCH 3/3] Pull CUE4Parse --- CUE4Parse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CUE4Parse b/CUE4Parse index 0cd21c2d..4dc3db99 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 0cd21c2d96068d29b812c9d0538de5654d8fbab5 +Subproject commit 4dc3db99ed8e0992938aa6d447f544bb31908ff1