From b4b26e3a1de490ff527e15b2a2cf7f528dc591a6 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 16 Oct 2025 17:40:19 +0900 Subject: [PATCH] Remove song select dependency from FooterButtonOptions --- .../Visual/SongSelectV2/TestSceneScreenFooter.cs | 2 +- osu.Game/Screens/OsuScreen.cs | 2 -- osu.Game/Screens/SelectV2/FooterButtonOptions.cs | 8 ++++++-- osu.Game/Screens/SelectV2/SongSelect.cs | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tests/Visual/SongSelectV2/TestSceneScreenFooter.cs b/osu.Game.Tests/Visual/SongSelectV2/TestSceneScreenFooter.cs index e247b92f52..bb0fb16dcf 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(), + new FooterButtonOptions(null), }); }); diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 1307be6494..ce04db0189 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -117,8 +117,6 @@ namespace osu.Game.Screens internal void CreateLeasedDependencies(IReadOnlyDependencyContainer dependencies) => createDependencies(dependencies); - internal void LoadComponentsAgainstScreenDependencies(IEnumerable components) => LoadComponents(components); - protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) { if (screenDependencies == null) diff --git a/osu.Game/Screens/SelectV2/FooterButtonOptions.cs b/osu.Game/Screens/SelectV2/FooterButtonOptions.cs index 3371785dd2..3e08e69bf8 100644 --- a/osu.Game/Screens/SelectV2/FooterButtonOptions.cs +++ b/osu.Game/Screens/SelectV2/FooterButtonOptions.cs @@ -23,8 +23,12 @@ namespace osu.Game.Screens.SelectV2 [Resolved] private IBindable beatmap { get; set; } = null!; - [Resolved] - private ISongSelect? songSelect { get; set; } + private readonly ISongSelect? songSelect; + + public FooterButtonOptions(ISongSelect? songSelect) + { + this.songSelect = songSelect; + } [BackgroundDependencyLoader] private void load(OsuColour colour) diff --git a/osu.Game/Screens/SelectV2/SongSelect.cs b/osu.Game/Screens/SelectV2/SongSelect.cs index e8843876d3..f047184d99 100644 --- a/osu.Game/Screens/SelectV2/SongSelect.cs +++ b/osu.Game/Screens/SelectV2/SongSelect.cs @@ -352,7 +352,7 @@ namespace osu.Game.Screens.SelectV2 errorSample?.Play(); } }, - new FooterButtonOptions + new FooterButtonOptions(this) { Hotkey = GlobalAction.ToggleBeatmapOptions, }