From 0a3f05c52b7be65c8c559914ef84e122ce63d110 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 14 May 2025 17:05:27 +0900 Subject: [PATCH] Allow accessing song select v2 by holding control while entering song select --- .../TestSceneSongSelectNavigation.cs | 100 ------------------ osu.Game/Screens/Menu/MainMenu.cs | 9 +- 2 files changed, 8 insertions(+), 101 deletions(-) delete mode 100644 osu.Game.Tests/Visual/Navigation/TestSceneSongSelectNavigation.cs diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneSongSelectNavigation.cs b/osu.Game.Tests/Visual/Navigation/TestSceneSongSelectNavigation.cs deleted file mode 100644 index 5c6138596a..0000000000 --- a/osu.Game.Tests/Visual/Navigation/TestSceneSongSelectNavigation.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using System; -using NUnit.Framework; -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Cursor; -using osu.Framework.Screens; -using osu.Game.Database; -using osu.Game.Overlays; -using osu.Game.Overlays.Toolbar; -using osu.Game.Screens; -using osu.Game.Screens.Footer; -using osu.Game.Screens.Menu; -using osu.Game.Screens.SelectV2; - -namespace osu.Game.Tests.Visual.Navigation -{ - [Explicit] - public partial class TestSceneSongSelectNavigation : ScreenTestScene - { - [Cached] - private readonly ScreenFooter screenFooter; - - [Cached] - private readonly OsuLogo logo; - - [Cached(typeof(INotificationOverlay))] - private readonly INotificationOverlay notificationOverlay = new NotificationOverlay(); - - protected override bool UseOnlineAPI => true; - - public TestSceneSongSelectNavigation() - { - Children = new Drawable[] - { - new PopoverContainer - { - RelativeSizeAxes = Axes.Both, - Children = new Drawable[] - { - new Toolbar - { - State = { Value = Visibility.Visible }, - }, - screenFooter = new ScreenFooter - { - OnBack = () => Stack.CurrentScreen.Exit(), - }, - logo = new OsuLogo - { - Alpha = 0f, - }, - }, - }, - }; - - Stack.Padding = new MarginPadding { Top = Toolbar.HEIGHT }; - } - - [BackgroundDependencyLoader] - private void load() - { - RealmDetachedBeatmapStore beatmapStore; - Dependencies.CacheAs(beatmapStore = new RealmDetachedBeatmapStore()); - Add(beatmapStore); - } - - protected override void LoadComplete() - { - base.LoadComplete(); - - Stack.ScreenPushed += updateFooter; - Stack.ScreenExited += updateFooter; - } - - public override void SetUpSteps() - { - base.SetUpSteps(); - AddStep("load screen", () => Stack.Push(new SoloSongSelect())); - AddUntilStep("wait for load", () => Stack.CurrentScreen is SoloSongSelect songSelect && songSelect.IsLoaded); - } - - private void updateFooter(IScreen? _, IScreen? newScreen) - { - if (newScreen is IOsuScreen osuScreen && osuScreen.ShowFooter) - { - screenFooter.Show(); - screenFooter.SetButtons(osuScreen.CreateFooterButtons()); - } - else - { - screenFooter.Hide(); - screenFooter.SetButtons(Array.Empty()); - } - } - } -} diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index c7d57f2993..fba321d128 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -43,6 +43,7 @@ using osu.Game.Seasonal; using osuTK; using osuTK.Graphics; using osu.Game.Localisation; +using osu.Game.Screens.SelectV2; namespace osu.Game.Screens.Menu { @@ -239,7 +240,13 @@ namespace osu.Game.Screens.Menu public void ReturnToOsuLogo() => Buttons.State = ButtonSystemState.Initial; - private void loadSoloSongSelect() => this.Push(new PlaySongSelect()); + private void loadSoloSongSelect() + { + if (GetContainingInputManager()!.CurrentState.Keyboard.ControlPressed) + this.Push(new SoloSongSelect()); + else + this.Push(new PlaySongSelect()); + } public override void OnEntering(ScreenTransitionEvent e) {