Test Penumbra loading CharacterUtility.

This commit is contained in:
Ottermandias 2022-06-27 15:19:58 +02:00
parent 32cf729aa8
commit 5aeff6d40f
5 changed files with 92 additions and 84 deletions

View file

@ -62,13 +62,12 @@ public unsafe class CharacterUtility : IDisposable
public CharacterUtility()
{
SignatureHelper.Initialise( this );
Dalamud.Framework.Update += LoadDefaultResources;
LoadingFinished += () => PluginLog.Debug( "Loading of CharacterUtility finished." );
LoadingFinished += () => PluginLog.Debug( "Loading of CharacterUtility finished." );
LoadDefaultResources( true );
}
// We store the default data of the resources so we can always restore them.
private void LoadDefaultResources( object _ )
private void LoadDefaultResources( bool repeat )
{
var missingCount = 0;
if( Address == null )
@ -95,10 +94,15 @@ public unsafe class CharacterUtility : IDisposable
if( missingCount == 0 )
{
Dalamud.Framework.Update -= LoadDefaultResources;
Ready = true;
Ready = true;
LoadingFinished.Invoke();
}
else if( repeat )
{
PluginLog.Debug( "Custom load of character resources triggered." );
LoadCharacterResources();
LoadDefaultResources( false );
}
}
// Set the data of one of the stored resources to a given pointer and length.