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