mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-15 05:04:15 +01:00
Make penumbra initialization before game code has run possible.
This commit is contained in:
parent
f13893cf77
commit
9ae843731d
19 changed files with 610 additions and 672 deletions
|
|
@ -11,7 +11,6 @@ public unsafe class CharacterUtility : IDisposable
|
|||
[Signature( "48 8B 0D ?? ?? ?? ?? E8 ?? ?? ?? 00 48 8D 8E ?? ?? 00 00 E8 ?? ?? ?? 00 33 D2", ScanType = ScanType.StaticAddress )]
|
||||
private readonly Structs.CharacterUtility** _characterUtilityAddress = null;
|
||||
|
||||
|
||||
// Only required for migration anymore.
|
||||
public delegate void LoadResources( Structs.CharacterUtility* address );
|
||||
|
||||
|
|
@ -62,12 +61,12 @@ public unsafe class CharacterUtility : IDisposable
|
|||
public CharacterUtility()
|
||||
{
|
||||
SignatureHelper.Initialise( this );
|
||||
LoadingFinished += () => PluginLog.Debug( "Loading of CharacterUtility finished." );
|
||||
LoadDefaultResources( true );
|
||||
Dalamud.Framework.Update += LoadDefaultResources;
|
||||
LoadingFinished += () => PluginLog.Debug( "Loading of CharacterUtility finished." );
|
||||
}
|
||||
|
||||
// We store the default data of the resources so we can always restore them.
|
||||
private void LoadDefaultResources( bool repeat )
|
||||
private void LoadDefaultResources( object _ )
|
||||
{
|
||||
var missingCount = 0;
|
||||
if( Address == null )
|
||||
|
|
@ -96,12 +95,7 @@ public unsafe class CharacterUtility : IDisposable
|
|||
{
|
||||
Ready = true;
|
||||
LoadingFinished.Invoke();
|
||||
}
|
||||
else if( repeat )
|
||||
{
|
||||
PluginLog.Debug( "Custom load of character resources triggered." );
|
||||
LoadCharacterResources();
|
||||
LoadDefaultResources( false );
|
||||
Dalamud.Framework.Update -= LoadDefaultResources;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue