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 @@ public override void OnSuspending(IScreen next)
buttons.State = ButtonSystemState.EnteringMode;
songTicker.Hide();
songTicker.AllowUpdates = false;
this.FadeOut(FADE_OUT_DURATION, Easing.InSine);
buttonsContainer.MoveTo(new Vector2(-800, 0), FADE_OUT_DURATION, Easing.InSine);
@ -246,7 +248,8 @@ public override void OnSuspending(IScreen next)
public override void OnResuming(IScreen last)
{
base.OnResuming(last);
songTicker.Hide();
songTicker.AllowUpdates = true;
(Background as BackgroundScreenDefault)?.Next();

View File

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