mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +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 string? _currentActorName = null;
|
||||||
private LoadingFlags _currentActorStartState = 0;
|
private LoadingFlags _currentActorStartState = 0;
|
||||||
private RedrawType _currentActorRedrawType = RedrawType.Unload;
|
private RedrawType _currentActorRedrawType = RedrawType.Unload;
|
||||||
|
private bool _wasTarget = false;
|
||||||
|
|
||||||
public static IntPtr RenderPtr( Actor actor )
|
public static IntPtr RenderPtr( Actor actor )
|
||||||
=> actor.Address + RenderModeOffset;
|
=> actor.Address + RenderModeOffset;
|
||||||
|
|
@ -167,6 +168,8 @@ namespace Penumbra.Interop
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_wasTarget = actor.Address == _pi.ClientState.Targets.CurrentTarget.Address;
|
||||||
|
|
||||||
++_currentFrame;
|
++_currentFrame;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -231,7 +234,7 @@ namespace Penumbra.Interop
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteVisible( actor, idx );
|
WriteVisible( actor, idx );
|
||||||
_currentFrame = _changedSettings ? _currentFrame + 1 : 0;
|
_currentFrame = _changedSettings || _wasTarget ? _currentFrame + 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RevertSettings()
|
private void RevertSettings()
|
||||||
|
|
@ -242,6 +245,8 @@ namespace Penumbra.Interop
|
||||||
if( !StillLoading( RenderPtr( actor ) ) )
|
if( !StillLoading( RenderPtr( actor ) ) )
|
||||||
{
|
{
|
||||||
RestoreSettings();
|
RestoreSettings();
|
||||||
|
if (_wasTarget && _pi.ClientState.Targets.CurrentTarget == null)
|
||||||
|
_pi.ClientState.Targets.SetCurrentTarget( actor );
|
||||||
_currentFrame = 0;
|
_currentFrame = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue