mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 04:34:19 +01:00
Try to fix actor redrawing stalling again, some fixes for collections not correctly reloading metadata or changing wrong collection. Added hidden debug tab that can be activated by /penumbra debug (and is active when compiled in debug mode by default).
This commit is contained in:
parent
cfdff30189
commit
cf223c927c
15 changed files with 309 additions and 60 deletions
|
|
@ -21,9 +21,9 @@ namespace Penumbra.Meta
|
|||
public FileInformation( object data )
|
||||
=> Data = data;
|
||||
|
||||
public void Write( DirectoryInfo dir )
|
||||
public void Write( DirectoryInfo dir, GamePath originalPath )
|
||||
{
|
||||
byte[] data = Data switch
|
||||
var data = Data switch
|
||||
{
|
||||
EqdpFile eqdp => eqdp.WriteBytes(),
|
||||
EqpFile eqp => eqp.WriteBytes(),
|
||||
|
|
@ -34,7 +34,7 @@ namespace Penumbra.Meta
|
|||
_ => throw new NotImplementedException(),
|
||||
};
|
||||
DisposeFile( CurrentFile );
|
||||
CurrentFile = TempFile.WriteNew( dir, data );
|
||||
CurrentFile = TempFile.WriteNew( dir, data, $"_{originalPath.Filename()}" );
|
||||
Changed = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -93,22 +93,28 @@ namespace Penumbra.Meta
|
|||
public void Dispose()
|
||||
=> Reset();
|
||||
|
||||
private void ClearDirectory()
|
||||
private static void ClearDirectory( DirectoryInfo modDir )
|
||||
{
|
||||
_dir.Refresh();
|
||||
if( _dir.Exists )
|
||||
modDir.Refresh();
|
||||
if( modDir.Exists )
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.Delete( _dir.FullName, true );
|
||||
Directory.Delete( modDir.FullName, true );
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
PluginLog.Error( $"Could not clear temporary metafile directory \"{_dir.FullName}\":\n{e}" );
|
||||
PluginLog.Error( $"Could not clear temporary metafile directory \"{modDir.FullName}\":\n{e}" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ClearDirectory()
|
||||
=> ClearDirectory( _dir );
|
||||
|
||||
public static void ClearBaseDirectory( DirectoryInfo modDir )
|
||||
=> ClearDirectory( new DirectoryInfo( Path.Combine( modDir.FullName, TmpDirectory ) ) );
|
||||
|
||||
public MetaManager( string name, Dictionary< GamePath, FileInfo > resolvedFiles, DirectoryInfo modDir )
|
||||
{
|
||||
_resolvedFiles = resolvedFiles;
|
||||
|
|
@ -123,7 +129,7 @@ namespace Penumbra.Meta
|
|||
Directory.CreateDirectory( _dir.FullName );
|
||||
foreach( var kvp in _currentFiles.Where( kvp => kvp.Value.Changed ) )
|
||||
{
|
||||
kvp.Value.Write( _dir );
|
||||
kvp.Value.Write( _dir, kvp.Key );
|
||||
_resolvedFiles[ kvp.Key ] = kvp.Value.CurrentFile!;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue