mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 07:42:57 +08:00
Add the ability to ignore the user's mouse movement.
This commit is contained in:
parent
ad93eda399
commit
023a5c6e4f
@ -18,6 +18,8 @@ namespace osu.Game.Rulesets.Osu
|
||||
set => ((OsuKeyBindingContainer)KeyBindingContainer).AllowUserPresses = value;
|
||||
}
|
||||
|
||||
public bool AllowUserCursorMovement { get; set; } = true;
|
||||
|
||||
protected override RulesetKeyBindingContainer CreateKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
|
||||
=> new OsuKeyBindingContainer(ruleset, variant, unique);
|
||||
|
||||
@ -26,6 +28,16 @@ namespace osu.Game.Rulesets.Osu
|
||||
{
|
||||
}
|
||||
|
||||
protected override bool Handle(UIEvent e)
|
||||
{
|
||||
if (!AllowUserCursorMovement && e is MouseMoveEvent)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.Handle(e);
|
||||
}
|
||||
|
||||
private class OsuKeyBindingContainer : RulesetKeyBindingContainer
|
||||
{
|
||||
public bool AllowUserPresses = true;
|
||||
|
Loading…
Reference in New Issue
Block a user