diff --git a/Penumbra/Interop/Resolver/PathResolver.Animation.cs b/Penumbra/Interop/Resolver/PathResolver.Animation.cs index 4b2992a2..563b32ca 100644 --- a/Penumbra/Interop/Resolver/PathResolver.Animation.cs +++ b/Penumbra/Interop/Resolver/PathResolver.Animation.cs @@ -1,10 +1,6 @@ using System; -using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Hooking; -using Dalamud.Logging; using Dalamud.Utility.Signatures; -using FFXIVClientStructs.FFXIV.Client.Game.Character; -using FFXIVClientStructs.FFXIV.Client.Game.Object; using Penumbra.Collections; using GameObject = FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject; @@ -13,6 +9,7 @@ namespace Penumbra.Interop.Resolver; public unsafe partial class PathResolver { private ModCollection? _animationLoadCollection; + private ModCollection? _lastAvfxCollection = null; public delegate ulong LoadTimelineResourcesDelegate( IntPtr timeline ); @@ -123,16 +120,4 @@ public unsafe partial class PathResolver SomeOtherAvfxHook!.Original( unk ); _animationLoadCollection = last; } - - public delegate IntPtr SomeAtexDelegate( IntPtr a1, IntPtr a2, IntPtr a3, IntPtr a4, uint a5, IntPtr a6 ); - - [Signature( "E8 ?? ?? ?? ?? 84 C0 75 ?? 48 8B CE 41 B6" )] - public Hook< SomeAtexDelegate >? SomeAtexHook; - - public IntPtr SomeAtexDetour( IntPtr a1, IntPtr a2, IntPtr a3, IntPtr a4, uint a5, IntPtr a6 ) - { - var ret = SomeAtexHook!.Original( a1, a2, a3, a4, a5, a6 ); - PluginLog.Information( $"{a1:X} {a2:X} {a3:X} {a4:X} {a5:X} {a6:X} {ret}" ); - return ret; - } } \ No newline at end of file diff --git a/Penumbra/Interop/Resolver/PathResolver.Data.cs b/Penumbra/Interop/Resolver/PathResolver.Data.cs index f51d1371..42e201ae 100644 --- a/Penumbra/Interop/Resolver/PathResolver.Data.cs +++ b/Penumbra/Interop/Resolver/PathResolver.Data.cs @@ -99,7 +99,6 @@ public unsafe partial class PathResolver LoadSomePapHook?.Enable(); SomeActionLoadHook?.Enable(); SomeOtherAvfxHook?.Enable(); - SomeAtexHook?.Enable(); } private void DisableDataHooks() @@ -115,7 +114,6 @@ public unsafe partial class PathResolver LoadSomePapHook?.Disable(); SomeActionLoadHook?.Disable(); SomeOtherAvfxHook?.Disable(); - SomeAtexHook?.Disable(); } private void DisposeDataHooks() @@ -130,7 +128,6 @@ public unsafe partial class PathResolver LoadSomePapHook?.Dispose(); SomeActionLoadHook?.Dispose(); SomeOtherAvfxHook?.Dispose(); - SomeAtexHook?.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 7af31623..f8c99e1c 100644 --- a/Penumbra/Interop/Resolver/PathResolver.cs +++ b/Penumbra/Interop/Resolver/PathResolver.cs @@ -44,7 +44,7 @@ public partial class PathResolver : IDisposable || PathCollections.TryRemove( gamePath.Path, out collection ) || HandleAnimationFile( type, gamePath, out collection ) || HandleDecalFile( type, gamePath, out collection ); - if( !nonDefault || collection == null) + if( !nonDefault || collection == null ) { collection = Penumbra.CollectionManager.Default; } @@ -60,7 +60,7 @@ public partial class PathResolver : IDisposable return true; } - private bool HandleDecalFile( ResourceType type, Utf8GamePath gamePath, [NotNullWhen(true)] out ModCollection? collection ) + private bool HandleDecalFile( ResourceType type, Utf8GamePath gamePath, [NotNullWhen( true )] out ModCollection? collection ) { if( type == ResourceType.Tex && _lastCreatedCollection != null @@ -74,27 +74,43 @@ public partial class PathResolver : IDisposable return false; } - 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.Atex ) - if (_animationLoadCollection == null) - PluginLog.Information( $"ATEX {_} Default" ); - else - { - PluginLog.Information( $"ATEX {_} {_animationLoadCollection?.Name}" ); - } - if( _animationLoadCollection != null ) + switch( type ) { - switch( type ) - { - case ResourceType.Tmb: - case ResourceType.Pap: - case ResourceType.Avfx: - case ResourceType.Atex: - case ResourceType.Scd: + case ResourceType.Tmb: + case ResourceType.Pap: + case ResourceType.Scd: + if( _animationLoadCollection != null ) + { collection = _animationLoadCollection; return true; - } + } + + break; + case ResourceType.Avfx: + _lastAvfxCollection = _animationLoadCollection ?? Penumbra.CollectionManager.Default; + if( _animationLoadCollection != null ) + { + collection = _animationLoadCollection; + return true; + } + + break; + case ResourceType.Atex: + if( _lastAvfxCollection != null ) + { + collection = _lastAvfxCollection; + return true; + } + + if( _animationLoadCollection != null ) + { + collection = _animationLoadCollection; + return true; + } + + break; } collection = null; diff --git a/Penumbra/Penumbra.cs b/Penumbra/Penumbra.cs index 82c6bcf1..993b5edc 100644 --- a/Penumbra/Penumbra.cs +++ b/Penumbra/Penumbra.cs @@ -504,6 +504,12 @@ public class Penumbra : IDisposable CollectionManager.Default.Index ); sb.AppendFormat( "> **`Current Collection: `** {0}... ({1})\n", CollectionName( CollectionManager.Current ), CollectionManager.Current.Index ); + foreach( var type in CollectionTypeExtensions.Special ) + { + var collection = CollectionManager.ByType( type ); + if( collection != null ) + sb.AppendFormat( "> **`{0,-29}`** {1}... ({2})\n", type.ToName(), CollectionName( collection ), collection.Index ); + } foreach( var (name, collection) in CollectionManager.Characters ) { sb.AppendFormat( "> **`{2,-29}`** {0}... ({1})\n", CollectionName( collection ),