mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 18:32:55 +08:00
Add xmldoc and throw a local exception on null background
This commit is contained in:
parent
11a0c637bc
commit
e9d4e4d1d5
@ -34,6 +34,10 @@ namespace osu.Game.Screens
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apply arbitrary changes to this background in a thread safe manner.
|
||||
/// </summary>
|
||||
/// <param name="action">The operation to perform.</param>
|
||||
public void ApplyToBackground(Action<BackgroundScreen> action) => Schedule(() => action.Invoke(this));
|
||||
|
||||
protected override void Update()
|
||||
|
@ -115,8 +115,6 @@ namespace osu.Game.Screens
|
||||
Mods = screenDependencies.Mods;
|
||||
}
|
||||
|
||||
public void ApplyToBackground(Action<BackgroundScreen> action) => background.ApplyToBackground(action);
|
||||
|
||||
/// <summary>
|
||||
/// The background created and owned by this screen. May be null if the background didn't change.
|
||||
/// </summary>
|
||||
@ -148,6 +146,18 @@ namespace osu.Game.Screens
|
||||
Activity.Value ??= InitialActivity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apply arbitrary changes to the current background screen in a thread safe manner.
|
||||
/// </summary>
|
||||
/// <param name="action">The operation to perform.</param>
|
||||
public void ApplyToBackground(Action<BackgroundScreen> action)
|
||||
{
|
||||
if (background == null)
|
||||
throw new InvalidOperationException("Attempted to apply to background before screen is pushed");
|
||||
|
||||
background.ApplyToBackground(action);
|
||||
}
|
||||
|
||||
public override void OnResuming(IScreen last)
|
||||
{
|
||||
if (PlayResumeSound)
|
||||
|
Loading…
Reference in New Issue
Block a user