Some animation adjustments

This commit is contained in:
Andrei Zavatski 2020-01-11 07:17:13 +03:00
parent 7716a555ec
commit d59cae33d3
2 changed files with 7 additions and 3 deletions

View File

@ -70,6 +70,7 @@ namespace osu.Game.Screens.Menu
private ExitConfirmOverlay exitConfirmOverlay; private ExitConfirmOverlay exitConfirmOverlay;
private ParallaxContainer buttonsContainer; private ParallaxContainer buttonsContainer;
private SongTicker songTicker;
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load(DirectOverlay direct, SettingsOverlay settings, OsuConfigManager config, SessionStatics statics) private void load(DirectOverlay direct, SettingsOverlay settings, OsuConfigManager config, SessionStatics statics)
@ -77,7 +78,7 @@ namespace osu.Game.Screens.Menu
holdDelay = config.GetBindable<float>(OsuSetting.UIHoldActivationDelay); holdDelay = config.GetBindable<float>(OsuSetting.UIHoldActivationDelay);
loginDisplayed = statics.GetBindable<bool>(Static.LoginOverlayDisplayed); loginDisplayed = statics.GetBindable<bool>(Static.LoginOverlayDisplayed);
AddInternal(new SongTicker AddInternal(songTicker = new SongTicker
{ {
Anchor = Anchor.TopRight, Anchor = Anchor.TopRight,
Origin = Anchor.TopRight, Origin = Anchor.TopRight,
@ -235,6 +236,7 @@ namespace osu.Game.Screens.Menu
buttons.State = ButtonSystemState.EnteringMode; buttons.State = ButtonSystemState.EnteringMode;
songTicker.Hide();
this.FadeOut(FADE_OUT_DURATION, Easing.InSine); this.FadeOut(FADE_OUT_DURATION, Easing.InSine);
buttonsContainer.MoveTo(new Vector2(-800, 0), FADE_OUT_DURATION, Easing.InSine); buttonsContainer.MoveTo(new Vector2(-800, 0), FADE_OUT_DURATION, Easing.InSine);
@ -244,6 +246,7 @@ namespace osu.Game.Screens.Menu
public override void OnResuming(IScreen last) public override void OnResuming(IScreen last)
{ {
base.OnResuming(last); base.OnResuming(last);
songTicker.Hide();
(Background as BackgroundScreenDefault)?.Next(); (Background as BackgroundScreenDefault)?.Next();
@ -272,6 +275,7 @@ namespace osu.Game.Screens.Menu
buttons.State = ButtonSystemState.Exit; buttons.State = ButtonSystemState.Exit;
this.FadeOut(3000); this.FadeOut(3000);
songTicker.Hide();
return base.OnExiting(next); return base.OnExiting(next);
} }

View File

@ -14,7 +14,7 @@ namespace osu.Game.Screens.Menu
{ {
public class SongTicker : Container public class SongTicker : Container
{ {
private const int duration = 500; private const int fade_duration = 800;
[Resolved] [Resolved]
private Bindable<WorkingBeatmap> beatmap { get; set; } private Bindable<WorkingBeatmap> beatmap { get; set; }
@ -60,7 +60,7 @@ namespace osu.Game.Screens.Menu
title.Text = working.NewValue?.Metadata?.Title; title.Text = working.NewValue?.Metadata?.Title;
artist.Text = working.NewValue?.Metadata?.Artist; artist.Text = working.NewValue?.Metadata?.Artist;
this.FadeIn(duration, Easing.OutQuint).Delay(4000).Then().FadeOut(duration, Easing.OutQuint); this.FadeIn(fade_duration, Easing.OutQuint).Delay(4000).Then().FadeOut(fade_duration, Easing.OutQuint);
} }
} }
} }