mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-15 05:04:15 +01:00
Test Penumbra loading CharacterUtility.
This commit is contained in:
parent
32cf729aa8
commit
5aeff6d40f
5 changed files with 92 additions and 84 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue