Fix logo animations

This commit is contained in:
smoogipoo 2019-01-25 21:02:35 +09:00
parent 60cc2314ef
commit 117703374e
2 changed files with 22 additions and 13 deletions

View File

@ -181,11 +181,8 @@ public bool OnExiting(IScreen next)
loungeSubScreen.MakeCurrent();
updatePollingRate(isIdle.Value);
logo?.AppendAnimatingAction(() =>
{
// the wave overlay transition takes longer than expected to run.
logo.Delay(WaveContainer.DISAPPEAR_DURATION / 2).FadeOut();
}, false);
// the wave overlay transition takes longer than expected to run.
logo?.AppendAnimatingAction(() => logo.Delay(WaveContainer.DISAPPEAR_DURATION / 2).FadeOut(), false);
return false;
}
@ -195,6 +192,8 @@ public void OnResuming(IScreen last)
this.FadeIn(250);
this.ScaleTo(1, 250, Easing.OutSine);
logo?.AppendAnimatingAction(() => OsuScreen.ApplyLogoArrivingDefaults(logo), true);
updatePollingRate(isIdle.Value);
}

View File

@ -155,14 +155,7 @@ public override bool OnExiting(IScreen next)
/// </summary>
protected virtual void LogoArriving(OsuLogo logo, bool resuming)
{
logo.Action = null;
logo.FadeOut(300, Easing.OutQuint);
logo.Anchor = Anchor.TopLeft;
logo.Origin = Anchor.Centre;
logo.RelativePositionAxes = Axes.None;
logo.BeatMatching = true;
logo.Triangles = true;
logo.Ripple = true;
ApplyLogoArrivingDefaults(logo);
}
private void applyArrivingDefaults(bool isResuming)
@ -179,6 +172,23 @@ private void applyArrivingDefaults(bool isResuming)
updateOverlayStates?.Invoke();
}
/// <summary>
/// Applies default animations to an arriving logo.
/// Todo: This should not exist.
/// </summary>
/// <param name="logo">The logo to apply animations to.</param>
public static void ApplyLogoArrivingDefaults(OsuLogo logo)
{
logo.Action = null;
logo.FadeOut(300, Easing.OutQuint);
logo.Anchor = Anchor.TopLeft;
logo.Origin = Anchor.Centre;
logo.RelativePositionAxes = Axes.None;
logo.BeatMatching = true;
logo.Triangles = true;
logo.Ripple = true;
}
private void onExitingLogo()
{
logo.AppendAnimatingAction(() => LogoExiting(logo), false);