mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Reapply target after redraw if the actor was targeted before and no new target was set.
This commit is contained in:
parent
fb5648b176
commit
ba23de2345
1 changed files with 6 additions and 1 deletions
|
|
@ -45,6 +45,7 @@ namespace Penumbra.Interop
|
|||
private string? _currentActorName = null;
|
||||
private LoadingFlags _currentActorStartState = 0;
|
||||
private RedrawType _currentActorRedrawType = RedrawType.Unload;
|
||||
private bool _wasTarget = false;
|
||||
|
||||
public static IntPtr RenderPtr( Actor actor )
|
||||
=> actor.Address + RenderModeOffset;
|
||||
|
|
@ -167,6 +168,8 @@ namespace Penumbra.Interop
|
|||
return;
|
||||
}
|
||||
|
||||
_wasTarget = actor.Address == _pi.ClientState.Targets.CurrentTarget.Address;
|
||||
|
||||
++_currentFrame;
|
||||
}
|
||||
else
|
||||
|
|
@ -231,7 +234,7 @@ namespace Penumbra.Interop
|
|||
}
|
||||
|
||||
WriteVisible( actor, idx );
|
||||
_currentFrame = _changedSettings ? _currentFrame + 1 : 0;
|
||||
_currentFrame = _changedSettings || _wasTarget ? _currentFrame + 1 : 0;
|
||||
}
|
||||
|
||||
private void RevertSettings()
|
||||
|
|
@ -242,6 +245,8 @@ namespace Penumbra.Interop
|
|||
if( !StillLoading( RenderPtr( actor ) ) )
|
||||
{
|
||||
RestoreSettings();
|
||||
if (_wasTarget && _pi.ClientState.Targets.CurrentTarget == null)
|
||||
_pi.ClientState.Targets.SetCurrentTarget( actor );
|
||||
_currentFrame = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue