1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 11:02:57 +08:00

Improve the look of the transition on hotkey retry (and retry in general).

This commit is contained in:
Dean Herbert 2017-04-11 19:58:57 +09:00
parent 9e6fa965b2
commit 1a1607aaaa
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49

View File

@ -116,7 +116,12 @@ namespace osu.Game.Screens.Play
scoreProcessor = HitRenderer.CreateScoreProcessor();
hudOverlay = new StandardHudOverlay();
hudOverlay = new StandardHudOverlay()
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre
};
hudOverlay.KeyCounter.Add(ruleset.CreateGameplayKeys());
hudOverlay.BindProcessor(scoreProcessor);
hudOverlay.BindHitRenderer(HitRenderer);
@ -160,7 +165,12 @@ namespace osu.Game.Screens.Play
},
new HotkeyRetryOverlay
{
Action = Restart,
Action = () => {
//we want to hide the hitrenderer immediately (looks better).
//we may be able to remove this once the mouse cursor trail is improved.
HitRenderer?.Hide();
Restart();
},
}
};
}
@ -304,8 +314,7 @@ namespace osu.Game.Screens.Play
protected override void OnSuspending(Screen next)
{
Content.FadeOut(350);
Content.ScaleTo(0.7f, 750, EasingTypes.InQuint);
fadeOut();
base.OnSuspending(next);
}
@ -324,14 +333,22 @@ namespace osu.Game.Screens.Play
}
}
HitRenderer?.FadeOut(60);
FadeOut(250);
Content.ScaleTo(0.7f, 750, EasingTypes.InQuint);
Background?.FadeTo(1f, 200);
fadeOut();
return base.OnExiting(next);
}
private void fadeOut()
{
const float fade_out_duration = 250;
HitRenderer?.FadeOut(fade_out_duration);
Content.FadeOut(fade_out_duration);
hudOverlay.ScaleTo(0.7f, fade_out_duration * 3, EasingTypes.In);
Background?.FadeTo(1f, fade_out_duration);
}
private Bindable<bool> mouseWheelDisabled;
protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !IsPaused;