Add another another animation hook. I hate animations.

This commit is contained in:
Ottermandias 2022-06-19 15:00:24 +02:00
parent c64743ee98
commit 8422d36e4e
3 changed files with 16 additions and 3 deletions

View file

@ -73,6 +73,7 @@ public unsafe partial class PathResolver
return ret; return ret;
} }
// Unknown what exactly this is but it seems to load a bunch of paps.
public delegate void LoadSomePap( IntPtr a1, int a2, IntPtr a3, int a4 ); public delegate void LoadSomePap( IntPtr a1, int a2, IntPtr a3, int a4 );
[Signature( "48 89 5C 24 ?? 48 89 6C 24 ?? 48 89 74 24 ?? 57 41 56 41 57 48 83 EC ?? 41 8B D9 89 51" )] [Signature( "48 89 5C 24 ?? 48 89 6C 24 ?? 48 89 74 24 ?? 57 41 56 41 57 48 83 EC ?? 41 8B D9 89 51" )]
@ -93,4 +94,16 @@ public unsafe partial class PathResolver
LoadSomePapHook!.Original( a1, a2, a3, a4 ); LoadSomePapHook!.Original( a1, a2, a3, a4 );
_animationLoadCollection = last; _animationLoadCollection = last;
} }
// Seems to load character actions when zoning or changing class, maybe.
[Signature( "E8 ?? ?? ?? ?? C6 83 ?? ?? ?? ?? ?? 8B 8E", DetourName = nameof( SomeActionLoadDetour ) )]
public Hook< CharacterBaseDestructorDelegate >? SomeActionLoadHook;
private void SomeActionLoadDetour( IntPtr gameObject )
{
var last = _animationLoadCollection;
_animationLoadCollection = IdentifyCollection( ( GameObject* )gameObject );
SomeActionLoadHook!.Original( gameObject );
_animationLoadCollection = last;
}
} }

View file

@ -94,6 +94,7 @@ public unsafe partial class PathResolver
CharacterBaseLoadAnimationHook?.Enable(); CharacterBaseLoadAnimationHook?.Enable();
LoadSomeAvfxHook?.Enable(); LoadSomeAvfxHook?.Enable();
LoadSomePapHook?.Enable(); LoadSomePapHook?.Enable();
SomeActionLoadHook?.Enable();
} }
private void DisableDataHooks() private void DisableDataHooks()
@ -107,6 +108,7 @@ public unsafe partial class PathResolver
CharacterBaseLoadAnimationHook?.Disable(); CharacterBaseLoadAnimationHook?.Disable();
LoadSomeAvfxHook?.Disable(); LoadSomeAvfxHook?.Disable();
LoadSomePapHook?.Disable(); LoadSomePapHook?.Disable();
SomeActionLoadHook?.Disable();
} }
private void DisposeDataHooks() private void DisposeDataHooks()
@ -119,6 +121,7 @@ public unsafe partial class PathResolver
CharacterBaseLoadAnimationHook?.Dispose(); CharacterBaseLoadAnimationHook?.Dispose();
LoadSomeAvfxHook?.Dispose(); LoadSomeAvfxHook?.Dispose();
LoadSomePapHook?.Dispose(); LoadSomePapHook?.Dispose();
SomeActionLoadHook?.Dispose();
} }
// This map links DrawObjects directly to Actors (by ObjectTable index) and their collections. // This map links DrawObjects directly to Actors (by ObjectTable index) and their collections.

View file

@ -76,9 +76,6 @@ public partial class PathResolver : IDisposable
private bool HandleAnimationFile( ResourceType type, Utf8GamePath _, [NotNullWhen(true)] out ModCollection? collection ) private bool HandleAnimationFile( ResourceType type, Utf8GamePath _, [NotNullWhen(true)] out ModCollection? collection )
{ {
if( type == ResourceType.Pap && _.Path.EndsWith( '0', '1', '0', '.', 'p', 'a', 'p' ) )
PluginLog.Information( $"PAPPITY PAP {_}" );
if( _animationLoadCollection != null ) if( _animationLoadCollection != null )
{ {
switch( type ) switch( type )