1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 20:13:22 +08:00

Merge pull request #23529 from peppy/no-hold-during-gameplay

Fix hold-for-right-click showing during gameplay
This commit is contained in:
Bartłomiej Dach 2023-05-13 15:33:13 +02:00 committed by GitHub
commit 732bd7812b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -3,6 +3,7 @@
#nullable disable
using osu.Framework.Bindables;
using osu.Framework.Input;
using osuTK.Input;
@ -10,6 +11,10 @@ namespace osu.Game.Input
{
public partial class OsuUserInputManager : UserInputManager
{
protected override bool AllowRightClickFromLongTouch => !LocalUserPlaying.Value;
public readonly BindableBool LocalUserPlaying = new BindableBool();
internal OsuUserInputManager()
{
}

View File

@ -269,6 +269,13 @@ namespace osu.Game
if (hideToolbar) Toolbar.Hide();
}
protected override UserInputManager CreateUserInputManager()
{
var userInputManager = base.CreateUserInputManager();
(userInputManager as OsuUserInputManager)?.LocalUserPlaying.BindTo(LocalUserPlaying);
return userInputManager;
}
private DependencyContainer dependencies;
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) =>

View File

@ -28,6 +28,8 @@ namespace osu.Game.Rulesets.UI
public abstract partial class RulesetInputManager<T> : PassThroughInputManager, ICanAttachHUDPieces, IHasReplayHandler, IHasRecordingHandler
where T : struct
{
protected override bool AllowRightClickFromLongTouch => false;
public readonly KeyBindingContainer<T> KeyBindingContainer;
[Resolved(CanBeNull = true)]