mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 12:14:17 +01:00
Try to associate battle voices to characters.
This commit is contained in:
parent
506f7d5824
commit
d5e2fc3b05
1 changed files with 35 additions and 3 deletions
|
|
@ -16,6 +16,7 @@ public unsafe partial class PathResolver
|
||||||
|
|
||||||
private ResolveData _animationLoadData = ResolveData.Invalid;
|
private ResolveData _animationLoadData = ResolveData.Invalid;
|
||||||
private ResolveData _lastAvfxData = ResolveData.Invalid;
|
private ResolveData _lastAvfxData = ResolveData.Invalid;
|
||||||
|
private ResolveData _characterSoundData = ResolveData.Invalid;
|
||||||
|
|
||||||
public AnimationState( DrawObjectState drawObjectState )
|
public AnimationState( DrawObjectState drawObjectState )
|
||||||
{
|
{
|
||||||
|
|
@ -27,9 +28,22 @@ public unsafe partial class PathResolver
|
||||||
{
|
{
|
||||||
switch( type )
|
switch( type )
|
||||||
{
|
{
|
||||||
|
case ResourceType.Scd:
|
||||||
|
if( _characterSoundData.Valid )
|
||||||
|
{
|
||||||
|
resolveData = _characterSoundData;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( _animationLoadData.Valid )
|
||||||
|
{
|
||||||
|
resolveData = _animationLoadData;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
case ResourceType.Tmb:
|
case ResourceType.Tmb:
|
||||||
case ResourceType.Pap:
|
case ResourceType.Pap:
|
||||||
case ResourceType.Scd:
|
|
||||||
if( _animationLoadData.Valid )
|
if( _animationLoadData.Valid )
|
||||||
{
|
{
|
||||||
resolveData = _animationLoadData;
|
resolveData = _animationLoadData;
|
||||||
|
|
@ -76,6 +90,7 @@ public unsafe partial class PathResolver
|
||||||
_loadSomePapHook.Enable();
|
_loadSomePapHook.Enable();
|
||||||
_someActionLoadHook.Enable();
|
_someActionLoadHook.Enable();
|
||||||
_someOtherAvfxHook.Enable();
|
_someOtherAvfxHook.Enable();
|
||||||
|
_loadCharacterSoundHook.Enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Disable()
|
public void Disable()
|
||||||
|
|
@ -86,6 +101,7 @@ public unsafe partial class PathResolver
|
||||||
_loadSomePapHook.Disable();
|
_loadSomePapHook.Disable();
|
||||||
_someActionLoadHook.Disable();
|
_someActionLoadHook.Disable();
|
||||||
_someOtherAvfxHook.Disable();
|
_someOtherAvfxHook.Disable();
|
||||||
|
_loadCharacterSoundHook.Disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
|
@ -96,6 +112,22 @@ public unsafe partial class PathResolver
|
||||||
_loadSomePapHook.Dispose();
|
_loadSomePapHook.Dispose();
|
||||||
_someActionLoadHook.Dispose();
|
_someActionLoadHook.Dispose();
|
||||||
_someOtherAvfxHook.Dispose();
|
_someOtherAvfxHook.Dispose();
|
||||||
|
_loadCharacterSoundHook.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Characters load some of their voice lines or whatever with this function.
|
||||||
|
private delegate IntPtr LoadCharacterSound( IntPtr character, int unk1, int unk2, IntPtr unk3, ulong unk4, int unk5, int unk6, ulong unk7 );
|
||||||
|
|
||||||
|
[Signature( "4C 89 4C 24 ?? 55 57 41 56", DetourName = nameof( LoadCharacterSoundDetour ) )]
|
||||||
|
private readonly Hook< LoadCharacterSound > _loadCharacterSoundHook = null!;
|
||||||
|
|
||||||
|
private IntPtr LoadCharacterSoundDetour( IntPtr character, int unk1, int unk2, IntPtr unk3, ulong unk4, int unk5, int unk6, ulong unk7 )
|
||||||
|
{
|
||||||
|
var last = _characterSoundData;
|
||||||
|
_characterSoundData = IdentifyCollection( ( GameObject* )character, true );
|
||||||
|
var ret = _loadCharacterSoundHook.Original( character, unk1, unk2, unk3, unk4, unk5, unk6, unk7 );
|
||||||
|
_characterSoundData = last;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The timeline object loads the requested .tmb and .pap files. The .tmb files load the respective .avfx files.
|
// The timeline object loads the requested .tmb and .pap files. The .tmb files load the respective .avfx files.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue