1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +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
parent 5cdaafdb1e
commit e0e7e123bf
No known key found for this signature in database
GPG Key ID: DF758C8A6271E098

View File

@ -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;