mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-01-02 05:43:42 +01:00
Make saving files and recalculating effective files threaded/once per frame.
This commit is contained in:
parent
b8210e094b
commit
67de0ccf45
14 changed files with 147 additions and 42 deletions
|
|
@ -57,7 +57,15 @@ public interface IModGroup : IEnumerable< ISubMod >
|
|||
}
|
||||
}
|
||||
|
||||
public static void SaveModGroup( IModGroup group, DirectoryInfo basePath, int groupIdx )
|
||||
public static void SaveDelayed( IModGroup group, DirectoryInfo basePath, int groupIdx )
|
||||
{
|
||||
Penumbra.Framework.RegisterDelayed( $"{nameof( SaveModGroup )}_{basePath.Name}_{group.Name}", () => SaveModGroup( group, basePath, groupIdx ) );
|
||||
}
|
||||
|
||||
public static void Save( IModGroup group, DirectoryInfo basePath, int groupIdx )
|
||||
=> SaveModGroup( group, basePath, groupIdx );
|
||||
|
||||
private static void SaveModGroup( IModGroup group, DirectoryInfo basePath, int groupIdx )
|
||||
{
|
||||
var file = group.FileName( basePath, groupIdx );
|
||||
using var s = File.Exists( file ) ? File.Open( file, FileMode.Truncate ) : File.Open( file, FileMode.CreateNew );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue