From afb758e61a9e658d1a30bc3ba18dacd980855330 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Sat, 4 Jun 2022 23:10:26 +0200 Subject: [PATCH] Disable additional pap handling for now. --- .../Resolver/PathResolver.Animation.cs | 44 +++++++++---------- .../Interop/Resolver/PathResolver.Data.cs | 13 +++--- Penumbra/Interop/Resolver/PathResolver.cs | 26 +++++------ 3 files changed, 42 insertions(+), 41 deletions(-) diff --git a/Penumbra/Interop/Resolver/PathResolver.Animation.cs b/Penumbra/Interop/Resolver/PathResolver.Animation.cs index 3c58519f..798929a7 100644 --- a/Penumbra/Interop/Resolver/PathResolver.Animation.cs +++ b/Penumbra/Interop/Resolver/PathResolver.Animation.cs @@ -10,33 +10,33 @@ public unsafe partial class PathResolver { // Probably used when the base idle animation gets loaded. // Make it aware of the correct collection to load the correct pap files. - [Signature( "E8 ?? ?? ?? ?? BA ?? ?? ?? ?? 48 8B CF 44 8B C2 E8 ?? ?? ?? ?? 48 8B 05", DetourName = "CharacterBaseLoadAnimationDetour" )] - public Hook< CharacterBaseDestructorDelegate >? CharacterBaseLoadAnimationHook; - - private ModCollection? _animationLoadCollection; - - private void CharacterBaseLoadAnimationDetour( IntPtr drawObject ) - { - _animationLoadCollection = _lastCreatedCollection - ?? ( FindParent( drawObject, out var collection ) != null ? collection : Penumbra.CollectionManager.Default ); - CharacterBaseLoadAnimationHook!.Original( drawObject ); - _animationLoadCollection = null; - } + //[Signature( "E8 ?? ?? ?? ?? BA ?? ?? ?? ?? 48 8B CF 44 8B C2 E8 ?? ?? ?? ?? 48 8B 05", DetourName = "CharacterBaseLoadAnimationDetour" )] + //public Hook< CharacterBaseDestructorDelegate >? CharacterBaseLoadAnimationHook; + // + //private ModCollection? _animationLoadCollection; + // + //private void CharacterBaseLoadAnimationDetour( IntPtr drawObject ) + //{ + // _animationLoadCollection = _lastCreatedCollection + // ?? ( FindParent( drawObject, out var collection ) != null ? collection : Penumbra.CollectionManager.Default ); + // CharacterBaseLoadAnimationHook!.Original( drawObject ); + // _animationLoadCollection = null; + //} // Probably used when action paps are loaded. // Make it aware of the correct collection to load the correct pap files. - public delegate void PapLoadFunction( IntPtr drawObject, IntPtr a2, uint a3, IntPtr a4, uint a5, uint a6, uint a7 ); + //public delegate void PapLoadFunction( IntPtr drawObject, IntPtr a2, uint a3, IntPtr a4, uint a5, uint a6, uint a7 ); - [Signature( "E8 ?? ?? ?? ?? 0F 10 00 0F 11 06", DetourName = "RandomPapDetour" )] - public Hook< PapLoadFunction >? RandomPapHook; + //[Signature( "E8 ?? ?? ?? ?? 0F 10 00 0F 11 06", DetourName = "RandomPapDetour" )] + //public Hook< PapLoadFunction >? RandomPapHook; - private void RandomPapDetour( IntPtr drawObject, IntPtr a2, uint a3, IntPtr a4, uint a5, uint a6, uint a7 ) - { - _animationLoadCollection = _lastCreatedCollection - ?? ( FindParent( drawObject, out var collection ) != null ? collection : Penumbra.CollectionManager.Default ); - RandomPapHook!.Original( drawObject, a2, a3, a4, a5, a6, a7 ); - _animationLoadCollection = null; - } + //private void RandomPapDetour( IntPtr drawObject, IntPtr a2, uint a3, IntPtr a4, uint a5, uint a6, uint a7 ) + //{ + // _animationLoadCollection = _lastCreatedCollection + // ?? ( FindParent( drawObject, out var collection ) != null ? collection : Penumbra.CollectionManager.Default ); + // RandomPapHook!.Original( drawObject, a2, a3, a4, a5, a6, a7 ); + // _animationLoadCollection = null; + //} //private void TestFunction() //{ diff --git a/Penumbra/Interop/Resolver/PathResolver.Data.cs b/Penumbra/Interop/Resolver/PathResolver.Data.cs index 2dd3bd85..97ff113c 100644 --- a/Penumbra/Interop/Resolver/PathResolver.Data.cs +++ b/Penumbra/Interop/Resolver/PathResolver.Data.cs @@ -72,28 +72,29 @@ public unsafe partial class PathResolver CharacterBaseCreateHook?.Enable(); EnableDrawHook?.Enable(); CharacterBaseDestructorHook?.Enable(); - CharacterBaseLoadAnimationHook?.Enable(); - RandomPapHook?.Enable(); Penumbra.CollectionManager.CollectionChanged += CheckCollections; + //CharacterBaseLoadAnimationHook?.Enable(); + //RandomPapHook?.Enable(); } private void DisableDataHooks() { Penumbra.CollectionManager.CollectionChanged -= CheckCollections; - RandomPapHook?.Disable(); - CharacterBaseLoadAnimationHook?.Disable(); CharacterBaseCreateHook?.Disable(); EnableDrawHook?.Disable(); CharacterBaseDestructorHook?.Disable(); + //RandomPapHook?.Disable(); + //CharacterBaseLoadAnimationHook?.Disable(); } private void DisposeDataHooks() { - CharacterBaseLoadAnimationHook?.Dispose(); + CharacterBaseCreateHook?.Dispose(); EnableDrawHook?.Dispose(); CharacterBaseDestructorHook?.Dispose(); - RandomPapHook?.Dispose(); + //RandomPapHook?.Dispose(); + //CharacterBaseLoadAnimationHook?.Dispose(); } // This map links DrawObjects directly to Actors (by ObjectTable index) and their collections. diff --git a/Penumbra/Interop/Resolver/PathResolver.cs b/Penumbra/Interop/Resolver/PathResolver.cs index c3b04436..98800933 100644 --- a/Penumbra/Interop/Resolver/PathResolver.cs +++ b/Penumbra/Interop/Resolver/PathResolver.cs @@ -40,7 +40,7 @@ public partial class PathResolver : IDisposable // A potential next request will add the path anew. var nonDefault = HandleMaterialSubFiles( type, out var collection ) || PathCollections.TryRemove( gamePath.Path, out collection ) - || HandlePapFile( type, gamePath, out collection ) + //|| HandlePapFile( type, gamePath, out collection ) || HandleDecalFile( type, gamePath, out collection ); if( !nonDefault ) { @@ -72,18 +72,18 @@ public partial class PathResolver : IDisposable return false; } - private bool HandlePapFile( ResourceType type, Utf8GamePath _, out ModCollection? collection ) - { - if( type is ResourceType.Pap or ResourceType.Tmb - && _animationLoadCollection != null ) - { - collection = _animationLoadCollection; - return true; - } - - collection = null; - return false; - } + //private bool HandlePapFile( ResourceType type, Utf8GamePath _, out ModCollection? collection ) + //{ + // if( type is ResourceType.Pap or ResourceType.Tmb + // && _animationLoadCollection != null ) + // { + // collection = _animationLoadCollection; + // return true; + // } + // + // collection = null; + // return false; + //} public void Enable() {