1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 07:23:14 +08:00

Adjust fade sequence and durations to feel better

This commit is contained in:
Dean Herbert 2020-10-20 15:03:33 +09:00
parent 4e57751ca1
commit 7a68636f71
2 changed files with 16 additions and 13 deletions

View File

@ -18,6 +18,8 @@ namespace osu.Game.Screens.Play
{
public class EpilepsyWarning : VisibilityContainer
{
public const double FADE_DURATION = 500;
private readonly BindableDouble trackVolumeOnEpilepsyWarning = new BindableDouble(1f);
private Track track;
@ -90,9 +92,7 @@ namespace osu.Game.Screens.Play
this.FadeIn(FADE_DURATION, Easing.OutQuint);
}
protected override void PopOut()
=> this.FadeOut(500, Easing.OutQuint)
.TransformBindableTo(trackVolumeOnEpilepsyWarning, 1, 500, Easing.OutQuint);
protected override void PopOut() => this.FadeOut(FADE_DURATION);
protected override void Dispose(bool isDisposing)
{

View File

@ -323,26 +323,29 @@ namespace osu.Game.Screens.Play
{
contentOut();
TransformSequence<PlayerLoader> pushSequence;
TransformSequence<PlayerLoader> pushSequence = this.Delay(250);
// only show if the warning was created (i.e. the beatmap needs it)
// and this is not a restart of the map (the warning expires after first load).
if (epilepsyWarning?.IsAlive == true)
{
epilepsyWarning.State.Value = Visibility.Visible;
const double epilepsy_display_length = 3000;
pushSequence = this.Delay(3000).Schedule(() =>
pushSequence.Schedule(() =>
{
epilepsyWarning.Hide();
epilepsyWarning.Expire();
epilepsyWarning.State.Value = Visibility.Visible;
this.Delay(epilepsy_display_length).Schedule(() =>
{
epilepsyWarning.Hide();
epilepsyWarning.Expire();
});
});
}
else
{
pushSequence = this.Delay(0);
pushSequence.Delay(epilepsy_display_length);
}
pushSequence.Delay(250).Schedule(() =>
pushSequence.Schedule(() =>
{
if (!this.IsCurrentScreen()) return;