mirror of
https://github.com/ppy/osu
synced 2025-01-11 00:29:30 +00:00
Keep menus open when clicking a stateful item with CTRL held
This commit is contained in:
parent
5cdaafdb1e
commit
e0e7e123bf
@ -4,6 +4,7 @@
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Input;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
@ -19,6 +20,17 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
protected override TextContainer CreateTextContainer() => new ToggleTextContainer(Item);
|
||||
|
||||
private InputManager inputManager = null!;
|
||||
|
||||
public override bool CloseMenuOnClick => !inputManager.CurrentState.Keyboard.ControlPressed;
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
inputManager = GetContainingInputManager();
|
||||
}
|
||||
|
||||
private partial class ToggleTextContainer : TextContainer
|
||||
{
|
||||
private readonly StatefulMenuItem menuItem;
|
||||
|
Loading…
Reference in New Issue
Block a user