diff --git a/osu.Game.Tests/Visual/SongSelectV2/TestSceneScreenFooter.cs b/osu.Game.Tests/Visual/SongSelectV2/TestSceneScreenFooter.cs index bb0fb16dcf..e247b92f52 100644 --- a/osu.Game.Tests/Visual/SongSelectV2/TestSceneScreenFooter.cs +++ b/osu.Game.Tests/Visual/SongSelectV2/TestSceneScreenFooter.cs @@ -53,7 +53,7 @@ namespace osu.Game.Tests.Visual.SongSelectV2 { new FooterButtonMods(modOverlay) { Current = SelectedMods }, new FooterButtonRandom(), - new FooterButtonOptions(null), + new FooterButtonOptions(), }); }); diff --git a/osu.Game/Screens/SelectV2/FooterButtonOptions.cs b/osu.Game/Screens/SelectV2/FooterButtonOptions.cs index 8de0908af1..4da40559e9 100644 --- a/osu.Game/Screens/SelectV2/FooterButtonOptions.cs +++ b/osu.Game/Screens/SelectV2/FooterButtonOptions.cs @@ -24,12 +24,8 @@ namespace osu.Game.Screens.SelectV2 [Resolved] private IBindable workingBeatmap { get; set; } = null!; - private readonly ISongSelect? songSelect; - - public FooterButtonOptions(ISongSelect? songSelect) - { - this.songSelect = songSelect; - } + [Resolved] + private ISongSelect? songSelect { get; set; } [Resolved] private RealmAccess realm { get; set; } = null!; diff --git a/osu.Game/Screens/SelectV2/ISongSelect.cs b/osu.Game/Screens/SelectV2/ISongSelect.cs index 3fede4401f..6280e4048a 100644 --- a/osu.Game/Screens/SelectV2/ISongSelect.cs +++ b/osu.Game/Screens/SelectV2/ISongSelect.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; +using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Game.Beatmaps; using osu.Game.Graphics.UserInterface; @@ -12,6 +13,7 @@ namespace osu.Game.Screens.SelectV2 /// /// Actions exposed by song select which are used by subcomponents to perform top-level operations. /// + [Cached] public interface ISongSelect { /// diff --git a/osu.Game/Screens/SelectV2/SongSelect.cs b/osu.Game/Screens/SelectV2/SongSelect.cs index 6cfe7206f8..49d9bab9c2 100644 --- a/osu.Game/Screens/SelectV2/SongSelect.cs +++ b/osu.Game/Screens/SelectV2/SongSelect.cs @@ -63,7 +63,6 @@ namespace osu.Game.Screens.SelectV2 /// This screen is intended to house all components introduced in the new song select design to add transitions and examine the overall look. /// This will be gradually built upon and ultimately replace once everything is in place. /// - [Cached(typeof(ISongSelect))] public abstract partial class SongSelect : ScreenWithBeatmapBackground, IKeyBindingHandler, ISongSelect, IHandlePresentBeatmap { /// @@ -352,7 +351,7 @@ namespace osu.Game.Screens.SelectV2 errorSample?.Play(); } }, - new FooterButtonOptions(this) + new FooterButtonOptions { Hotkey = GlobalAction.ToggleBeatmapOptions, }