mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-06 17:58:05 +02:00
Sprite orientation improvements (#917)
* Fold animation delays into a single set for all directions. * Update systems to use new RSI animations API. * Fetching layer directions now done in sprite render. * Allow overriding direction in SpriteView.
This commit is contained in:
@@ -297,13 +297,13 @@ namespace Robust.Client.GameObjects
|
||||
}
|
||||
|
||||
// Calculate RSI animations.
|
||||
var delayCount = RsiState.DelayCount(RSI.State.Direction.South);
|
||||
var delayCount = RsiState.DelayCount;
|
||||
if (delayCount > 0 && (AnimationLoops || AnimationIndex < delayCount - 1))
|
||||
{
|
||||
AnimationTime += frameTime;
|
||||
while (RsiState.GetFrame(RSI.State.Direction.South, AnimationIndex).delay < AnimationTime)
|
||||
while (RsiState.GetDelay(AnimationIndex) < AnimationTime)
|
||||
{
|
||||
var (_, delay) = RsiState.GetFrame(RSI.State.Direction.South, AnimationIndex);
|
||||
var delay = RsiState.GetDelay(AnimationIndex);
|
||||
AnimationIndex += 1;
|
||||
AnimationTime -= delay;
|
||||
if (AnimationIndex == delayCount)
|
||||
@@ -318,7 +318,7 @@ namespace Robust.Client.GameObjects
|
||||
}
|
||||
}
|
||||
|
||||
EffectSprite = RsiState.GetFrame(RSI.State.Direction.South, AnimationIndex).icon;
|
||||
EffectSprite = RsiState.GetFrame(RSI.State.Direction.South, AnimationIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user