fix RepeatPoint animations

- FadeIn and -Out for RepeatPoints are now calculated instead of fixed values
- TimePreempt is now cut down if too long for RepeatPoints following the first one to only show up to two RepeatPoints at any given time
This commit is contained in:
Aergwyn
2018-01-22 12:36:38 +01:00
parent 85d1e81a92
commit 66176f2882
5 changed files with 36 additions and 26 deletions

View File

@ -72,12 +72,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
AddNested(InitialCircle);
var repeatDuration = s.Curve.Distance / s.Velocity;
foreach (var tick in s.NestedHitObjects.OfType<SliderTick>())
{
var repeatStartTime = s.StartTime + tick.RepeatIndex * repeatDuration;
var repeatStartTime = s.StartTime + tick.RepeatIndex * s.RepeatDuration;
var fadeInTime = repeatStartTime + (tick.StartTime - repeatStartTime) / 2 - (tick.RepeatIndex == 0 ? HitObject.TimeFadein : HitObject.TimeFadein / 2);
var fadeOutTime = repeatStartTime + repeatDuration;
var fadeOutTime = repeatStartTime + s.RepeatDuration;
var drawableTick = new DrawableSliderTick(tick)
{
@ -92,15 +91,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
foreach (var repeatPoint in s.NestedHitObjects.OfType<RepeatPoint>())
{
var repeatStartTime = s.StartTime + repeatPoint.RepeatIndex * repeatDuration;
var fadeInTime = repeatStartTime + (repeatPoint.StartTime - repeatStartTime) / 2 - (repeatPoint.RepeatIndex == 0 ? HitObject.TimeFadein : HitObject.TimeFadein / 2);
var fadeOutTime = repeatStartTime + repeatDuration;
var drawableRepeatPoint = new DrawableRepeatPoint(repeatPoint, this)
{
FadeInTime = fadeInTime,
FadeOutTime = fadeOutTime,
Position = repeatPoint.Position,
FadeInTime = repeatPoint.StartTime - s.RepeatDuration / 2,
Position = repeatPoint.Position
};
repeatPoints.Add(drawableRepeatPoint);