mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
ArmedState now considered, SliderBody now deflates (TODO: handle slider's nested objects)
This commit is contained in:
@ -7,6 +7,7 @@ using osu.Game.Rulesets.Mods;
|
|||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Mods
|
namespace osu.Game.Rulesets.Osu.Mods
|
||||||
{
|
{
|
||||||
@ -27,19 +28,53 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
|
|
||||||
private void drawableOnApplyCustomUpdateState(DrawableHitObject drawable, ArmedState state)
|
private void drawableOnApplyCustomUpdateState(DrawableHitObject drawable, ArmedState state)
|
||||||
{
|
{
|
||||||
if (!(drawable is DrawableHitCircle d))
|
if (!(drawable is DrawableOsuHitObject d))
|
||||||
return;
|
return;
|
||||||
d.ApproachCircle.Hide();
|
|
||||||
var h = d.HitObject;
|
var h = d.HitObject;
|
||||||
|
|
||||||
|
switch (drawable)
|
||||||
|
{
|
||||||
|
case DrawableHitCircle c:
|
||||||
|
c.ApproachCircle.Hide();
|
||||||
using (d.BeginAbsoluteSequence(h.StartTime - h.TimePreempt))
|
using (d.BeginAbsoluteSequence(h.StartTime - h.TimePreempt))
|
||||||
{
|
{
|
||||||
var origScale = d.Scale;
|
var origScale = d.Scale;
|
||||||
d.ScaleTo(1.1f, 1) // if duration = 0 then components (i.e. flash) scale with it -> we don't want that
|
d.ScaleTo(1.1f, 1)
|
||||||
.Then()
|
.Then()
|
||||||
.ScaleTo(origScale, h.TimePreempt)
|
.ScaleTo(origScale, h.TimePreempt);
|
||||||
|
}
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case ArmedState.Miss:
|
||||||
|
d.FadeOut(100);
|
||||||
|
break;
|
||||||
|
case ArmedState.Hit:
|
||||||
|
d.FadeOut(800)
|
||||||
|
.ScaleTo(d.Scale * 1.5f, 400, Easing.OutQuad);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DrawableSlider s:
|
||||||
|
using (d.BeginAbsoluteSequence(h.StartTime - h.TimePreempt + 1, true))
|
||||||
|
{
|
||||||
|
float origPathWidth = s.Body.PathWidth;
|
||||||
|
var origBodySize = s.Body.Size;
|
||||||
|
var origBodyDrawPos = s.Body.DrawPosition;
|
||||||
|
|
||||||
|
s.Body.MoveTo(origBodyDrawPos - new Vector2(origPathWidth), 1)
|
||||||
.Then()
|
.Then()
|
||||||
.FadeOut(800)
|
.MoveTo(origBodyDrawPos, h.TimePreempt);
|
||||||
.ScaleTo(d.Scale * 1.5f, 400, Easing.OutQuad); // reapply overwritten ScaleTo
|
|
||||||
|
s.Body.ResizeTo(origBodySize * 2, 1)
|
||||||
|
.Then()
|
||||||
|
.ResizeTo(origBodySize, h.TimePreempt);
|
||||||
|
|
||||||
|
s.Body.TransformTo("PathWidth", origPathWidth * 2, 1)
|
||||||
|
.Then()
|
||||||
|
.TransformTo("PathWidth", origPathWidth, h.TimePreempt);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user