Ensure that all changes to screen backgrounds are on the correct thread

This commit is contained in:
Dean Herbert
2021-01-04 18:32:23 +09:00
parent a3e4e2f6c3
commit b3f08b29ca
12 changed files with 132 additions and 60 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Game.Screens.Backgrounds;
namespace osu.Game.Screens.Play
@ -9,6 +10,6 @@ namespace osu.Game.Screens.Play
{
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap.Value);
public new BackgroundScreenBeatmap Background => (BackgroundScreenBeatmap)base.Background;
public void ApplyToBackground(Action<BackgroundScreenBeatmap> action) => base.ApplyToBackground(b => action.Invoke((BackgroundScreenBeatmap)b));
}
}