mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 17:37:23 +09: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;
|
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));
|
public void ApplyToBackground(Action<BackgroundScreen> action) => Schedule(() => action.Invoke(this));
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
@ -115,8 +115,6 @@ namespace osu.Game.Screens
|
|||||||
Mods = screenDependencies.Mods;
|
Mods = screenDependencies.Mods;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ApplyToBackground(Action<BackgroundScreen> action) => background.ApplyToBackground(action);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The background created and owned by this screen. May be null if the background didn't change.
|
/// The background created and owned by this screen. May be null if the background didn't change.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -148,6 +146,18 @@ namespace osu.Game.Screens
|
|||||||
Activity.Value ??= InitialActivity;
|
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)
|
public override void OnResuming(IScreen last)
|
||||||
{
|
{
|
||||||
if (PlayResumeSound)
|
if (PlayResumeSound)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user