mirror of
https://github.com/ppy/osu.git
synced 2026-06-03 03:20:16 +08:00
Allow accessing song select v2 by holding control while entering song select
This commit is contained in:
@@ -1,100 +0,0 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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>(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<ScreenFooterButton>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user