Get rid of raw AddDelay calls within osu.Game

This commit is contained in:
Thomas Müller
2017-07-17 16:51:21 +03:00
parent 19fb03e737
commit 87bcd526f3
19 changed files with 67 additions and 96 deletions

View File

@ -98,18 +98,13 @@ namespace osu.Game.Screens.Menu
{
base.OnEntering(last);
Content.FadeInFromZero(500);
icon.Delay(1500).FadeColour(iconColour, 200);
icon.AddDelay(1500);
icon.FadeColour(iconColour, 200);
AddDelay(6000, true);
Content.FadeOut(250);
AddDelay(250);
Schedule(() => Push(intro));
Content
.FadeInFromZero(500)
.Then(5500)
.FadeOut(250)
.Finally(d => Push(intro));
}
}
}

View File

@ -97,9 +97,9 @@ namespace osu.Game.Screens.Play.HUD
if (judgement.Result == HitResult.Miss)
return;
fill.FadeEdgeEffectTo(Math.Min(1, fill.EdgeEffect.Colour.Linear.A + (1f - base_glow_opacity) / glow_max_hits), 50, EasingTypes.OutQuint);
fill.AddDelay(glow_fade_delay);
fill.FadeEdgeEffectTo(base_glow_opacity, glow_fade_time, EasingTypes.OutQuint);
fill.FadeEdgeEffectTo(Math.Min(1, fill.EdgeEffect.Colour.Linear.A + (1f - base_glow_opacity) / glow_max_hits), 50, EasingTypes.OutQuint)
.Delay(glow_fade_delay)
.FadeEdgeEffectTo(base_glow_opacity, glow_fade_time, EasingTypes.OutQuint);
}
protected override void SetHealth(float value) => fill.ResizeTo(new Vector2(value, 1), 200, EasingTypes.OutQuint);

View File

@ -56,11 +56,7 @@ namespace osu.Game.Screens.Play
AddInternal(pauseOverlay = new PauseOverlay
{
OnResume = delegate
{
AddDelay(400);
Schedule(Resume);
},
OnResume = () => this.Delay(400).Schedule(Resume),
OnRetry = () => OnRetry(),
OnQuit = () => OnQuit(),
});

View File

@ -77,9 +77,7 @@ namespace osu.Game.Screens.Play
Beatmap = player.Beatmap,
});
AddDelay(400);
Schedule(pushWhenLoaded);
this.Delay(400).Schedule(pushWhenLoaded);
}
private void contentIn()
@ -104,16 +102,9 @@ namespace osu.Game.Screens.Play
contentIn();
AddDelay(500, true);
logo.MoveToOffset(new Vector2(0, -180), 500, EasingTypes.InOutExpo);
AddDelay(250, true);
info.FadeIn(500);
AddDelay(1400, true);
Schedule(pushWhenLoaded);
logo.Delay(500).MoveToOffset(new Vector2(0, -180), 500, EasingTypes.InOutExpo);
info.Delay(750).FadeIn(500);
this.Delay(2150).Schedule(pushWhenLoaded);
}
private void pushWhenLoaded()
@ -123,9 +114,7 @@ namespace osu.Game.Screens.Play
contentOut();
AddDelay(250);
Schedule(() =>
this.Delay(250).Schedule(() =>
{
if (!IsCurrentScreen) return;

View File

@ -33,8 +33,7 @@ namespace osu.Game.Screens.Ranking
protected override void LoadComplete()
{
base.LoadComplete();
fill.AddDelay(400);
fill.FadeInFromZero(600);
fill.Delay(400).FadeInFromZero(600);
}
[BackgroundDependencyLoader]

View File

@ -178,9 +178,9 @@ namespace osu.Game.Screens.Ranking
int delay = 0;
foreach (var s in statisticsContainer.Children)
{
s.FadeOut();
s.AddDelay(delay += 200);
s.FadeIn(300 + delay, EasingTypes.Out);
s.FadeOut()
.Then(delay += 200)
.FadeIn(300 + delay, EasingTypes.Out);
}
});
}

View File

@ -44,13 +44,14 @@ namespace osu.Game.Screens
boxContainer.ScaleTo(0.2f);
boxContainer.RotateTo(-20);
Content.AddDelay(300, true);
using (Content.BeginDelayedSequence(300, true))
{
boxContainer.ScaleTo(1, transition_time, EasingTypes.OutElastic);
boxContainer.RotateTo(0, transition_time / 2, EasingTypes.OutQuint);
boxContainer.ScaleTo(1, transition_time, EasingTypes.OutElastic);
boxContainer.RotateTo(0, transition_time / 2, EasingTypes.OutQuint);
textContainer.MoveTo(Vector2.Zero, transition_time, EasingTypes.OutExpo);
Content.FadeIn(transition_time, EasingTypes.OutExpo);
textContainer.MoveTo(Vector2.Zero, transition_time, EasingTypes.OutExpo);
Content.FadeIn(transition_time, EasingTypes.OutExpo);
}
}
protected override bool OnExiting(Screen next)

View File

@ -63,8 +63,8 @@ namespace osu.Game.Screens.Select.Leaderboards
};
scrollFlow.Add(ls);
ls.AddDelay(i++ * 50, true);
ls.Show();
using (BeginDelayedSequence(i++ * 50, true))
ls.Show();
}
scrollContainer.ScrollTo(0f, false);

View File

@ -64,23 +64,26 @@ namespace osu.Game.Screens.Select.Leaderboards
this.FadeIn(200);
content.MoveToY(0, 800, EasingTypes.OutQuint);
AddDelay(100, true);
avatar.FadeIn(300, EasingTypes.OutQuint);
nameLabel.FadeIn(350, EasingTypes.OutQuint);
avatar.MoveToX(0, 300, EasingTypes.OutQuint);
nameLabel.MoveToX(0, 350, EasingTypes.OutQuint);
AddDelay(250, true);
scoreLabel.FadeIn(200);
scoreRank.FadeIn(200);
AddDelay(50, true);
var drawables = new Drawable[] { flagBadgeContainer, maxCombo, accuracy, modsContainer, };
for (int i = 0; i < drawables.Length; i++)
using (BeginDelayedSequence(100, true))
{
drawables[i].FadeIn(100 + i * 50);
avatar.FadeIn(300, EasingTypes.OutQuint);
nameLabel.FadeIn(350, EasingTypes.OutQuint);
avatar.MoveToX(0, 300, EasingTypes.OutQuint);
nameLabel.MoveToX(0, 350, EasingTypes.OutQuint);
using (BeginDelayedSequence(250, true))
{
scoreLabel.FadeIn(200);
scoreRank.FadeIn(200);
using (BeginDelayedSequence(50, true))
{
var drawables = new Drawable[] { flagBadgeContainer, maxCombo, accuracy, modsContainer, };
for (int i = 0; i < drawables.Length; i++)
drawables[i].FadeIn(100 + i * 50);
}
}
}
break;