mirror of
https://github.com/ppy/osu.git
synced 2025-01-21 07:33:12 +08:00
Add workaround for dropdowns playing close animation on first display
This commit is contained in:
parent
5ce52b2669
commit
390abccb4b
@ -81,9 +81,13 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
sampleClose = audio.Samples.Get(@"UI/dropdown-close");
|
sampleClose = audio.Samples.Get(@"UI/dropdown-close");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo: this shouldn't be required after https://github.com/ppy/osu-framework/issues/4519 is fixed.
|
||||||
|
private bool wasOpened;
|
||||||
|
|
||||||
// todo: this uses the same styling as OsuMenu. hopefully we can just use OsuMenu in the future with some refactoring
|
// todo: this uses the same styling as OsuMenu. hopefully we can just use OsuMenu in the future with some refactoring
|
||||||
protected override void AnimateOpen()
|
protected override void AnimateOpen()
|
||||||
{
|
{
|
||||||
|
wasOpened = true;
|
||||||
this.FadeIn(300, Easing.OutQuint);
|
this.FadeIn(300, Easing.OutQuint);
|
||||||
sampleOpen?.Play();
|
sampleOpen?.Play();
|
||||||
}
|
}
|
||||||
@ -91,6 +95,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
protected override void AnimateClose()
|
protected override void AnimateClose()
|
||||||
{
|
{
|
||||||
this.FadeOut(300, Easing.OutQuint);
|
this.FadeOut(300, Easing.OutQuint);
|
||||||
|
if (wasOpened)
|
||||||
sampleClose?.Play();
|
sampleClose?.Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user