mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 20:54:16 +01:00
Cache collections instead of looking them up for every single file.
This commit is contained in:
parent
f676bd1889
commit
2fac923452
12 changed files with 194 additions and 28 deletions
|
|
@ -35,6 +35,8 @@ public class TempModManager
|
|||
public bool CollectionByName( string name, [NotNullWhen( true )] out ModCollection? collection )
|
||||
=> Collections.Values.FindFirst( c => string.Equals( c.Name, name, StringComparison.OrdinalIgnoreCase ), out collection );
|
||||
|
||||
public event ModCollection.Manager.CollectionChangeDelegate? CollectionChanged;
|
||||
|
||||
// These functions to check specific redirections or meta manipulations for existence are currently unused.
|
||||
//public bool IsRegistered( string tag, ModCollection? collection, Utf8GamePath gamePath, out FullPath? fullPath, out int priority )
|
||||
//{
|
||||
|
|
@ -151,6 +153,7 @@ public class TempModManager
|
|||
{
|
||||
var collection = ModCollection.CreateNewTemporary( tag, characterName );
|
||||
_collections[ characterName ] = collection;
|
||||
CollectionChanged?.Invoke(CollectionType.Temporary, null, collection );
|
||||
return collection.Name;
|
||||
}
|
||||
|
||||
|
|
@ -160,6 +163,7 @@ public class TempModManager
|
|||
{
|
||||
_mods.Remove( c );
|
||||
c.ClearCache();
|
||||
CollectionChanged?.Invoke( CollectionType.Temporary, c, null );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue