diff --git a/osu.Game/Screens/Play/FailOverlay.cs b/osu.Game/Screens/Play/FailOverlay.cs index ceabaee43b..0726536ddd 100644 --- a/osu.Game/Screens/Play/FailOverlay.cs +++ b/osu.Game/Screens/Play/FailOverlay.cs @@ -6,6 +6,7 @@ using osu.Framework.Input; using OpenTK.Input; using osu.Game.Graphics; using OpenTK.Graphics; +using osu.Framework.Allocation; namespace osu.Game.Screens.Play { @@ -26,7 +27,8 @@ namespace osu.Game.Screens.Play return base.OnKeyDown(state, args); } - protected override void AddButtons(OsuColour colours) + [BackgroundDependencyLoader] + private void load(OsuColour colours) { AddButton(@"Retry", colours.YellowDark, OnRetry); AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), OnQuit); diff --git a/osu.Game/Screens/Play/InGameOverlay.cs b/osu.Game/Screens/Play/InGameOverlay.cs index cdd858644d..d35fe28f3e 100644 --- a/osu.Game/Screens/Play/InGameOverlay.cs +++ b/osu.Game/Screens/Play/InGameOverlay.cs @@ -82,8 +82,6 @@ namespace osu.Game.Screens.Play protected override bool OnMouseMove(InputState state) => true; - protected abstract void AddButtons(OsuColour colours); - protected void AddButton(string text, Color4 colour, Action action) { buttons.Add(new PauseButton @@ -185,8 +183,6 @@ namespace osu.Game.Screens.Play }; Retries = 0; - - AddButtons(colours); } protected InGameOverlay() diff --git a/osu.Game/Screens/Play/PauseOverlay.cs b/osu.Game/Screens/Play/PauseOverlay.cs index a6b550368b..061b91d289 100644 --- a/osu.Game/Screens/Play/PauseOverlay.cs +++ b/osu.Game/Screens/Play/PauseOverlay.cs @@ -7,6 +7,7 @@ using osu.Game.Graphics; using OpenTK.Input; using osu.Framework.Graphics.Containers; using OpenTK.Graphics; +using osu.Framework.Allocation; namespace osu.Game.Screens.Play { @@ -29,7 +30,8 @@ namespace osu.Game.Screens.Play return base.OnKeyDown(state, args); } - protected override void AddButtons(OsuColour colours) + [BackgroundDependencyLoader] + private void load(OsuColour colours) { AddButton(@"Continue", colours.Green, OnResume); AddButton(@"Retry", colours.YellowDark, OnRetry);