mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-01-03 06:13:45 +01:00
Some fixes.
This commit is contained in:
parent
8fd9569508
commit
abce14dfdd
8 changed files with 50 additions and 148 deletions
|
|
@ -87,32 +87,31 @@ public partial class MetaManager
|
|||
|
||||
public bool RevertMod( ImcManipulation m )
|
||||
{
|
||||
#if USE_IMC
|
||||
if( _imcManipulations.Remove( m ) )
|
||||
if( !_imcManipulations.Remove( m ) )
|
||||
{
|
||||
var path = m.GamePath();
|
||||
if( !_imcFiles.TryGetValue( path, out var file ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var def = ImcFile.GetDefault( path, m.EquipSlot, m.Variant, out _ );
|
||||
var manip = m with { Entry = def };
|
||||
if( !manip.Apply( file ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var fullPath = CreateImcPath( path );
|
||||
if( _collection.HasCache )
|
||||
{
|
||||
_collection.ForceFile( path, fullPath );
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
|
||||
var path = m.GamePath();
|
||||
if( !_imcFiles.TryGetValue( path, out var file ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var def = ImcFile.GetDefault( path, m.EquipSlot, m.Variant, out _ );
|
||||
var manip = m with { Entry = def };
|
||||
if( !manip.Apply( file ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var fullPath = CreateImcPath( path );
|
||||
if( _collection.HasCache )
|
||||
{
|
||||
_collection.ForceFile( path, fullPath );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void DisposeImc()
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ using Penumbra.Mods;
|
|||
|
||||
namespace Penumbra.Meta.Manager;
|
||||
|
||||
public partial class MetaManager : IDisposable, IEnumerable<KeyValuePair<MetaManipulation, IMod>>
|
||||
public partial class MetaManager : IDisposable, IEnumerable< KeyValuePair< MetaManipulation, IMod > >
|
||||
{
|
||||
private readonly Dictionary< MetaManipulation, IMod > _manipulations = new();
|
||||
private readonly ModCollection _collection;
|
||||
|
|
@ -25,7 +25,7 @@ public partial class MetaManager : IDisposable, IEnumerable<KeyValuePair<MetaMan
|
|||
=> _manipulations.Keys;
|
||||
|
||||
|
||||
public IEnumerator<KeyValuePair<MetaManipulation, IMod>> GetEnumerator()
|
||||
public IEnumerator< KeyValuePair< MetaManipulation, IMod > > GetEnumerator()
|
||||
=> _manipulations.GetEnumerator();
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
|
|
@ -135,6 +135,12 @@ public partial class MetaManager : IDisposable, IEnumerable<KeyValuePair<MetaMan
|
|||
};
|
||||
}
|
||||
|
||||
if( Penumbra.CollectionManager.Default == _collection )
|
||||
{
|
||||
SetFiles();
|
||||
Penumbra.ResidentResources.Reload();
|
||||
}
|
||||
|
||||
Penumbra.CharacterUtility.LoadingFinished -= ApplyStoredManipulations;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue