Skip to content

Commit

Permalink
Fixing some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
donkeyProgramming committed Nov 24, 2024
1 parent 6af4ada commit 913d8a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions Shared/SharedCore/PackFiles/PackFileService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ public void AddContainer(PackFileContainer container, bool setToMainPackIfFirst
}
}

AddContainerInternal(container, setToMainPackIfFirst);
}

void AddContainerInternal(PackFileContainer container, bool setToMainPackIfFirst = false)
{
_packFileContainers.Add(container);
_globalEventHub?.PublishGlobalEvent(new PackFileContainerAddedEvent(container));

Expand All @@ -67,11 +72,10 @@ public PackFileContainer CreateNewPackFileContainer(string name, PackFileCAType
var newPackFile = new PackFileContainer(name)
{
Header = new PFHeader("PFH5", type),

};
AddContainer(newPackFile);
if (setEditablePack)
SetEditablePack(newPackFile);

AddContainerInternal(newPackFile, setEditablePack);

return newPackFile;
}

Expand Down
4 changes: 2 additions & 2 deletions Testing/E2EVerification/Shared/AssetEditorTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public AssetEditorTestRunner(GameTypeEnum gameEnum = GameTypeEnum.Warhammer3, bo
var loader = EditorServiceProvider.ServiceProvider.GetRequiredService<IPackFileContainerLoader>();
var container = loader.Load(path);
container.IsCaPackFile = true;
PackFileService.AddContainer(container, false);
PackFileService.AddContainer(container);

if (createOutputPackFile)
return PackFileService.CreateNewPackFileContainer("TestOutput", PackFileCAType.MOD, true);
Expand All @@ -58,7 +58,7 @@ public AssetEditorTestRunner(GameTypeEnum gameEnum = GameTypeEnum.Warhammer3, bo
var loader = EditorServiceProvider.ServiceProvider.GetRequiredService<IPackFileContainerLoader>();
var container = loader.LoadSystemFolderAsPackFileContainer(path);
container.IsCaPackFile = true;
PackFileService.AddContainer(container, false);
PackFileService.AddContainer(container);

if (createOutputPackFile)
return PackFileService.CreateNewPackFileContainer("TestOutput", PackFileCAType.MOD, true);
Expand Down

0 comments on commit 913d8a0

Please sign in to comment.