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

Change menus to fade out with a slight delay so settings changes are visible

Useful for cases like https://github.com/ppy/osu/pull/31778, where a
change to one setting can affect another.
This commit is contained in:
Dean Herbert 2025-02-03 17:36:47 +09:00
parent 5668a90781
commit df51d345c5
No known key found for this signature in database

View File

@ -68,7 +68,9 @@ namespace osu.Game.Graphics.UserInterface
if (!TopLevelMenu && wasOpened)
menuSamples?.PlayCloseSample();
this.FadeOut(300, Easing.OutQuint);
this.Delay(50)
.FadeOut(300, Easing.OutQuint);
wasOpened = false;
}
@ -77,12 +79,21 @@ namespace osu.Game.Graphics.UserInterface
if (Direction == Direction.Vertical)
{
Width = newSize.X;
this.ResizeHeightTo(newSize.Y, 300, Easing.OutQuint);
if (newSize.Y > 0)
this.ResizeHeightTo(newSize.Y, 300, Easing.OutQuint);
else
// Delay until the fade out finishes from AnimateClose.
this.Delay(350).ResizeHeightTo(0);
}
else
{
Height = newSize.Y;
this.ResizeWidthTo(newSize.X, 300, Easing.OutQuint);
if (newSize.X > 0)
this.ResizeWidthTo(newSize.X, 300, Easing.OutQuint);
else
// Delay until the fade out finishes from AnimateClose.
this.Delay(350).ResizeWidthTo(0);
}
}