SImplify everything

This commit is contained in:
Dean Herbert 2017-12-29 18:48:10 +09:00
parent 0ae00cbd17
commit dd2ae3f701

View File

@ -60,8 +60,6 @@ namespace osu.Game.Rulesets.Osu.Mods
d.FadeIn = fadeInDuration; d.FadeIn = fadeInDuration;
using (drawable.BeginAbsoluteSequence(fadeInStartTime, true))
{
switch (drawable) switch (drawable)
{ {
case DrawableHitCircle circle: case DrawableHitCircle circle:
@ -70,7 +68,10 @@ namespace osu.Game.Rulesets.Osu.Mods
// prolong the hitcircle long enough so misses are still possible // prolong the hitcircle long enough so misses are still possible
circle.LifetimeEnd = circle.HitObject.StartTime + Math.Max(fadeOutDuration, circle.HitObject.HitWindowFor(HitResult.Miss)); circle.LifetimeEnd = circle.HitObject.StartTime + Math.Max(fadeOutDuration, circle.HitObject.HitWindowFor(HitResult.Miss));
circle.FadeIn(fadeInDuration).Then().FadeOut(fadeOutDuration); // override fade in as it somehow gets cut otherwise
// fade out immediately after fade in.
using (drawable.BeginAbsoluteSequence(fadeInStartTime + fadeInDuration, true))
circle.FadeOut(fadeOutDuration);
break; break;
case DrawableSlider slider: case DrawableSlider slider:
using (slider.BeginAbsoluteSequence(fadeOutStartTime, true)) using (slider.BeginAbsoluteSequence(fadeOutStartTime, true))
@ -84,34 +85,36 @@ namespace osu.Game.Rulesets.Osu.Mods
slider.Delay(fadeOutDuration).Expire(); slider.Delay(fadeOutDuration).Expire();
} }
} }
break; break;
case DrawableSpinner spinner: case DrawableSpinner spinner:
spinner.Disc.FadeOut(); // hide elements we don't care about.
spinner.Ticks.FadeOut(); spinner.Disc.Hide();
spinner.Background.FadeOut(); spinner.Ticks.Hide();
spinner.Background.Hide();
using (spinner.BeginAbsoluteSequence(fadeOutStartTime, true)) using (spinner.BeginAbsoluteSequence(fadeOutStartTime + longFadeDuration, true))
{ {
var sequence = spinner.Delay(longFadeDuration).FadeOut(fadeOutDuration); spinner.FadeOut(fadeOutDuration);
// speed up the end sequence accordingly // speed up the end sequence accordingly
switch (state) switch (state)
{ {
case ArmedState.Hit: case ArmedState.Hit:
sequence.ScaleTo(spinner.Scale * 1.2f, fadeOutDuration * 2, Easing.Out); spinner.ScaleTo(spinner.Scale * 1.2f, fadeOutDuration * 2, Easing.Out);
break; break;
case ArmedState.Miss: case ArmedState.Miss:
sequence.ScaleTo(spinner.Scale * 0.8f, fadeOutDuration * 2, Easing.Out); spinner.ScaleTo(spinner.Scale * 0.8f, fadeOutDuration * 2, Easing.Out);
break; break;
} }
sequence.Expire(); spinner.Expire();
} }
break; break;
} }
} }
} }
}
public class OsuModHardRock : ModHardRock, IApplicableToHitObject<OsuHitObject> public class OsuModHardRock : ModHardRock, IApplicableToHitObject<OsuHitObject>
{ {