mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-01-03 14:23:43 +01:00
Actually clear cache and restore imc files.
This commit is contained in:
parent
4030487472
commit
b09a736a85
7 changed files with 50 additions and 15 deletions
|
|
@ -87,7 +87,6 @@ public partial class ModCollection
|
|||
newCollection.CreateCache();
|
||||
}
|
||||
|
||||
RemoveCache( oldCollectionIdx );
|
||||
switch( collectionType )
|
||||
{
|
||||
case CollectionType.Default:
|
||||
|
|
@ -110,6 +109,7 @@ public partial class ModCollection
|
|||
break;
|
||||
}
|
||||
|
||||
RemoveCache( oldCollectionIdx );
|
||||
|
||||
UpdateCurrentCollectionInUse();
|
||||
CollectionChanged.Invoke( collectionType, this[ oldCollectionIdx ], newCollection, characterName );
|
||||
|
|
@ -128,7 +128,7 @@ public partial class ModCollection
|
|||
// Create a special collection if it does not exist and set it to Empty.
|
||||
public bool CreateSpecialCollection( CollectionType collectionType )
|
||||
{
|
||||
if( !collectionType.IsSpecial() || _specialCollections[( int )collectionType] != null )
|
||||
if( !collectionType.IsSpecial() || _specialCollections[ ( int )collectionType ] != null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -136,7 +136,6 @@ public partial class ModCollection
|
|||
_specialCollections[ ( int )collectionType ] = Empty;
|
||||
CollectionChanged.Invoke( collectionType, null, Empty, null );
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
// Remove a special collection if it exists
|
||||
|
|
@ -361,7 +360,8 @@ public partial class ModCollection
|
|||
|
||||
private void RemoveCache( int idx )
|
||||
{
|
||||
if( idx != Default.Index
|
||||
if( idx != Empty.Index
|
||||
&& idx != Default.Index
|
||||
&& idx != Current.Index
|
||||
&& _specialCollections.All( c => c == null || c.Index != idx )
|
||||
&& _characters.Values.All( c => c.Index != idx ) )
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public partial class ModCollection
|
|||
|
||||
|
||||
// Clear the current cache.
|
||||
private void ClearCache()
|
||||
internal void ClearCache()
|
||||
{
|
||||
_cache?.Dispose();
|
||||
_cache = null;
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ public partial class ModCollection
|
|||
|
||||
public void Dispose()
|
||||
{
|
||||
MetaManipulations.Dispose();
|
||||
_collection.ModSettingChanged -= OnModSettingChange;
|
||||
_collection.InheritanceChanged -= OnInheritanceChange;
|
||||
Penumbra.CharacterUtility.LoadingFinished -= IncrementCounter;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue