From a9a5f91c907cb105fe9bf9fc2ab3457c703a444e Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Sun, 22 Jan 2023 16:09:46 +0100 Subject: [PATCH] Maybe fix animation handling after redraws (esp. for PLD with shield), maybe break everything else. --- Penumbra/Interop/Resolver/PathResolver.AnimationState.cs | 6 ++++++ Penumbra/Interop/Resolver/PathResolver.cs | 6 ++++++ Penumbra/UI/ConfigWindow.DebugTab.cs | 1 + 3 files changed, 13 insertions(+) diff --git a/Penumbra/Interop/Resolver/PathResolver.AnimationState.cs b/Penumbra/Interop/Resolver/PathResolver.AnimationState.cs index fcd5c2a0..60822ad0 100644 --- a/Penumbra/Interop/Resolver/PathResolver.AnimationState.cs +++ b/Penumbra/Interop/Resolver/PathResolver.AnimationState.cs @@ -58,6 +58,12 @@ public unsafe partial class PathResolver break; } + if( _drawObjectState.LastGameObject != null ) + { + resolveData = _drawObjectState.LastCreatedCollection; + return true; + } + resolveData = ResolveData.Invalid; return false; } diff --git a/Penumbra/Interop/Resolver/PathResolver.cs b/Penumbra/Interop/Resolver/PathResolver.cs index e00e9c45..46e075c7 100644 --- a/Penumbra/Interop/Resolver/PathResolver.cs +++ b/Penumbra/Interop/Resolver/PathResolver.cs @@ -183,4 +183,10 @@ public partial class PathResolver : IDisposable internal ResolveData CurrentAvfxData => _subFiles.AvfxData; + + internal ResolveData LastGameObjectData + => DrawObjects.LastCreatedCollection; + + internal unsafe nint LastGameObject + => (nint) DrawObjects.LastGameObject; } \ No newline at end of file diff --git a/Penumbra/UI/ConfigWindow.DebugTab.cs b/Penumbra/UI/ConfigWindow.DebugTab.cs index 3dc61dde..f25ed1d4 100644 --- a/Penumbra/UI/ConfigWindow.DebugTab.cs +++ b/Penumbra/UI/ConfigWindow.DebugTab.cs @@ -223,6 +223,7 @@ public partial class ConfigWindow return; } + ImGui.TextUnformatted( $"Last Game Object: 0x{_window._penumbra.PathResolver.LastGameObject:X} ({_window._penumbra.PathResolver.LastGameObjectData.ModCollection.Name})" ); using( var drawTree = ImRaii.TreeNode( "Draw Object to Object" ) ) { if( drawTree )