mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 16:03:14 +08:00
Merge pull request #11894 from peppy/fix-settings-from-main-menu
Fix global hotkeys not working from main menu before toolbar is initially shown
This commit is contained in:
commit
a9aed0eef4
@ -214,6 +214,21 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
AddAssert("Options overlay still visible", () => songSelect.BeatmapOptionsOverlay.State.Value == Visibility.Visible);
|
AddAssert("Options overlay still visible", () => songSelect.BeatmapOptionsOverlay.State.Value == Visibility.Visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestSettingsViaHotkeyFromMainMenu()
|
||||||
|
{
|
||||||
|
AddAssert("toolbar not displayed", () => Game.Toolbar.State.Value == Visibility.Hidden);
|
||||||
|
|
||||||
|
AddStep("press settings hotkey", () =>
|
||||||
|
{
|
||||||
|
InputManager.PressKey(Key.ControlLeft);
|
||||||
|
InputManager.Key(Key.O);
|
||||||
|
InputManager.ReleaseKey(Key.ControlLeft);
|
||||||
|
});
|
||||||
|
|
||||||
|
AddUntilStep("settings displayed", () => Game.Settings.State.Value == Visibility.Visible);
|
||||||
|
}
|
||||||
|
|
||||||
private void pushEscape() =>
|
private void pushEscape() =>
|
||||||
AddStep("Press escape", () => InputManager.Key(Key.Escape));
|
AddStep("Press escape", () => InputManager.Key(Key.Escape));
|
||||||
|
|
||||||
|
@ -37,6 +37,15 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
Size = new Vector2(1, HEIGHT);
|
Size = new Vector2(1, HEIGHT);
|
||||||
|
AlwaysPresent = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void UpdateAfterChildren()
|
||||||
|
{
|
||||||
|
base.UpdateAfterChildren();
|
||||||
|
|
||||||
|
// this only needed to be set for the initial LoadComplete/Update, so layout completes and gets buttons in a state they can correctly handle keyboard input for hotkeys.
|
||||||
|
AlwaysPresent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
|
Loading…
Reference in New Issue
Block a user