mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-21 23:37:47 +01:00
Change when the Deletion event is fired so that all mods are still there at invoke.
This commit is contained in:
parent
3d7faad2ae
commit
81435b4ff2
2 changed files with 5 additions and 5 deletions
|
|
@ -99,7 +99,7 @@ public partial class Mod
|
|||
}
|
||||
}
|
||||
|
||||
// Delete a mod by its index.
|
||||
// Delete a mod by its index. The event is invoked before the mod is removed from the list.
|
||||
// Deletes from filesystem as well as from internal data.
|
||||
// Updates indices of later mods.
|
||||
public void DeleteMod( int idx )
|
||||
|
|
@ -118,13 +118,13 @@ public partial class Mod
|
|||
}
|
||||
}
|
||||
|
||||
ModPathChanged.Invoke( ModPathChangeType.Deleted, mod, mod.ModPath, null );
|
||||
_mods.RemoveAt( idx );
|
||||
foreach( var remainingMod in _mods.Skip( idx ) )
|
||||
{
|
||||
--remainingMod.Index;
|
||||
}
|
||||
|
||||
ModPathChanged.Invoke( ModPathChangeType.Deleted, mod, mod.ModPath, null );
|
||||
PluginLog.Debug( "Deleted mod {Name:l}.", mod.Name );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue