mirror of
https://github.com/ppy/osu.git
synced 2025-02-12 18:03:22 +08:00
Use same delay in context menus
This commit is contained in:
parent
df51d345c5
commit
099ce39531
@ -12,8 +12,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public partial class OsuContextMenu : OsuMenu
|
||||
{
|
||||
private const int fade_duration = 250;
|
||||
|
||||
[Resolved]
|
||||
private OsuMenuSamples menuSamples { get; set; } = null!;
|
||||
|
||||
@ -48,7 +46,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
protected override void AnimateOpen()
|
||||
{
|
||||
wasOpened = true;
|
||||
this.FadeIn(fade_duration, Easing.OutQuint);
|
||||
this.FadeIn(FADE_DURATION, Easing.OutQuint);
|
||||
|
||||
if (!playClickSample)
|
||||
return;
|
||||
@ -59,7 +57,8 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
protected override void AnimateClose()
|
||||
{
|
||||
this.FadeOut(fade_duration, Easing.OutQuint);
|
||||
this.Delay(DELAY_BEFORE_FADE_OUT)
|
||||
.FadeOut(FADE_DURATION, Easing.OutQuint);
|
||||
|
||||
if (wasOpened)
|
||||
menuSamples.PlayCloseSample();
|
||||
|
@ -18,6 +18,9 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public partial class OsuMenu : Menu
|
||||
{
|
||||
protected const double DELAY_BEFORE_FADE_OUT = 50;
|
||||
protected const double FADE_DURATION = 280;
|
||||
|
||||
// todo: this shouldn't be required after https://github.com/ppy/osu-framework/issues/4519 is fixed.
|
||||
private bool wasOpened;
|
||||
|
||||
@ -68,8 +71,8 @@ namespace osu.Game.Graphics.UserInterface
|
||||
if (!TopLevelMenu && wasOpened)
|
||||
menuSamples?.PlayCloseSample();
|
||||
|
||||
this.Delay(50)
|
||||
.FadeOut(300, Easing.OutQuint);
|
||||
this.Delay(DELAY_BEFORE_FADE_OUT)
|
||||
.FadeOut(FADE_DURATION, Easing.OutQuint);
|
||||
|
||||
wasOpened = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user