1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 15:33:05 +08:00

Add AllowUpdates flag to SongTicker

This commit is contained in:
Andrei Zavatski 2020-01-11 18:27:22 +03:00
parent 81948744d0
commit bd33687f53
2 changed files with 9 additions and 1 deletions

View File

@ -237,6 +237,8 @@ namespace osu.Game.Screens.Menu
buttons.State = ButtonSystemState.EnteringMode; buttons.State = ButtonSystemState.EnteringMode;
songTicker.Hide(); songTicker.Hide();
songTicker.AllowUpdates = false;
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);
@ -246,7 +248,8 @@ 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();
songTicker.AllowUpdates = true;
(Background as BackgroundScreenDefault)?.Next(); (Background as BackgroundScreenDefault)?.Next();

View File

@ -17,6 +17,8 @@ namespace osu.Game.Screens.Menu
{ {
private const int fade_duration = 800; private const int fade_duration = 800;
public bool AllowUpdates { get; set; } = true;
[Resolved] [Resolved]
private Bindable<WorkingBeatmap> beatmap { get; set; } private Bindable<WorkingBeatmap> beatmap { get; set; }
@ -56,6 +58,9 @@ namespace osu.Game.Screens.Menu
private void onBeatmapChanged(ValueChangedEvent<WorkingBeatmap> working) private void onBeatmapChanged(ValueChangedEvent<WorkingBeatmap> working)
{ {
if (!AllowUpdates)
return;
var metadata = working.NewValue.Metadata; var metadata = working.NewValue.Metadata;
title.Text = new LocalisedString((metadata.TitleUnicode, metadata.Title)); title.Text = new LocalisedString((metadata.TitleUnicode, metadata.Title));