1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-27 01:13:52 +08:00

Keep menus open when clicking a stateful item with CTRL held

This commit is contained in:
Jonas Brandstötter
2024-05-03 16:57:31 +02:00
Unverified
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;