mirror of
https://github.com/osukey/osukey.git
synced 2025-07-11 05:10:10 +09:00
Add specific messaging for when there's no background stack available
This commit is contained in:
@ -125,6 +125,7 @@ namespace osu.Game.Screens
|
|||||||
private BackgroundScreen background;
|
private BackgroundScreen background;
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
[Resolved(canBeNull: true)]
|
||||||
|
[CanBeNull]
|
||||||
private BackgroundScreenStack backgroundStack { get; set; }
|
private BackgroundScreenStack backgroundStack { get; set; }
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
[Resolved(canBeNull: true)]
|
||||||
@ -152,8 +153,11 @@ namespace osu.Game.Screens
|
|||||||
/// <param name="action">The operation to perform.</param>
|
/// <param name="action">The operation to perform.</param>
|
||||||
public void ApplyToBackground(Action<BackgroundScreen> action)
|
public void ApplyToBackground(Action<BackgroundScreen> action)
|
||||||
{
|
{
|
||||||
|
if (backgroundStack == null)
|
||||||
|
throw new InvalidOperationException("Attempted to apply to background without a background stack being available.");
|
||||||
|
|
||||||
if (background == null)
|
if (background == null)
|
||||||
throw new InvalidOperationException("Attempted to apply to background before screen is pushed");
|
throw new InvalidOperationException("Attempted to apply to background before screen is pushed.");
|
||||||
|
|
||||||
background.ApplyToBackground(action);
|
background.ApplyToBackground(action);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user