Skip to content

Commit

Permalink
only parse content files
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeWanderer committed Oct 23, 2024
1 parent dacfac6 commit e4b26c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Games/NexusMods.Games.UnrealEngine/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public static partial class Constants
public static readonly Extension ConfigExt = new(".ini");
public static readonly Extension SavedGameExt = new(".sav");

/// <summary>
/// Default UE content files: <see cref="PakExt"/>, <see cref="UcasExt"/>, <see cref="UtocExt"/>, <see cref="SigExt"/>
/// </summary>
public static readonly HashSet<Extension> ContentExts = [PakExt, UcasExt, UtocExt, SigExt];
public static readonly HashSet<Extension> ArchiveExts = [new(".zip"), new(".rar")];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using NexusMods.Abstractions.Loadouts.Extensions;
using NexusMods.Paths;
using Diagnostic = NexusMods.Abstractions.Diagnostics.Diagnostic;
using System.Linq;

namespace NexusMods.Games.UnrealEngine.Emitters;

Expand All @@ -38,8 +39,11 @@ public async IAsyncEnumerable<Diagnostic> Diagnose(
.GetEnabledLoadoutFiles()
.Where(file =>
{
var loadoutItem = file.AsLoadoutItemWithTargetPath().AsLoadoutItem();
var targetedItem = file.AsLoadoutItemWithTargetPath();
var (_, _, relativePath) = targetedItem.TargetPath;
var loadoutItem = targetedItem.AsLoadoutItem();
if (loadoutItem.ParentId == default(LoadoutItemGroupId)) return false;
if(!Constants.ContentExts.Contains(relativePath.Extension)) return false;
return !loadoutItem.Parent.TryGetAsLoadoutGameFilesGroup(out _);
});

Expand Down

0 comments on commit e4b26c8

Please sign in to comment.