Added TestCase, first RepeatPoint now deflates aswell

This commit is contained in:
MaxOhn
2018-10-12 20:55:42 +02:00
parent 85190079e3
commit 19efa1cafb
3 changed files with 655 additions and 11 deletions

View File

@ -33,6 +33,8 @@ namespace osu.Game.Rulesets.Osu.Mods
var h = d.HitObject;
float rescale = 2;
switch (drawable)
{
case DrawableHitCircle c:
@ -55,6 +57,7 @@ namespace osu.Game.Rulesets.Osu.Mods
break;
}
break;
case DrawableSlider s:
using (d.BeginAbsoluteSequence(h.StartTime - h.TimePreempt + 1, true))
{
@ -62,19 +65,21 @@ namespace osu.Game.Rulesets.Osu.Mods
var origBodySize = s.Body.Size;
var origBodyDrawPos = s.Body.DrawPosition;
s.Body.MoveTo(origBodyDrawPos - new Vector2(origPathWidth), 1)
.Then()
.MoveTo(origBodyDrawPos, h.TimePreempt);
s.Body.ResizeTo(origBodySize * 2, 1)
.Then()
.ResizeTo(origBodySize, h.TimePreempt);
s.Body.TransformTo("PathWidth", origPathWidth * 2, 1)
.Then()
.TransformTo("PathWidth", origPathWidth, h.TimePreempt);
// Fits nicely for CS=4, too big on lower CS, too small on higher CS
s.Body.Animate(
b => b.MoveTo(origBodyDrawPos - new Vector2(origPathWidth)).MoveTo(origBodyDrawPos, h.TimePreempt),
b => b.ResizeTo(origBodySize * rescale).ResizeTo(origBodySize, h.TimePreempt),
b => b.TransformTo("PathWidth", origPathWidth * rescale).TransformTo("PathWidth", origPathWidth, h.TimePreempt)
);
}
break;
case DrawableRepeatPoint rp:
if (!rp.IsFirstRepeat)
break;
var origSizeRP = rp.Size;
using (d.BeginAbsoluteSequence(h.StartTime - h.TimePreempt + 1, true))
rp.ResizeTo(origSizeRP * rescale).ResizeTo(origSizeRP, h.TimePreempt);
break;
}
}
}

View File

@ -41,6 +41,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
};
}
public bool IsFirstRepeat => repeatPoint.RepeatIndex == 0;
protected override void CheckForResult(bool userTriggered, double timeOffset)
{
if (repeatPoint.StartTime <= Time.Current)