Fix hold-for-right-click showing during gameplay

This commit is contained in:
Dean Herbert 2023-05-13 21:12:21 +09:00
parent 3e8711ed96
commit 8c542c6c51
3 changed files with 14 additions and 0 deletions

View File

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

View File

@ -269,6 +269,13 @@ namespace osu.Game
if (hideToolbar) Toolbar.Hide(); if (hideToolbar) Toolbar.Hide();
} }
protected override UserInputManager CreateUserInputManager()
{
var userInputManager = base.CreateUserInputManager();
(userInputManager as OsuUserInputManager)?.LocalUserPlaying.BindTo(LocalUserPlaying);
return userInputManager;
}
private DependencyContainer dependencies; private DependencyContainer dependencies;
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) => 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 public abstract partial class RulesetInputManager<T> : PassThroughInputManager, ICanAttachHUDPieces, IHasReplayHandler, IHasRecordingHandler
where T : struct where T : struct
{ {
protected override bool AllowRightClickFromLongTouch => false;
public readonly KeyBindingContainer<T> KeyBindingContainer; public readonly KeyBindingContainer<T> KeyBindingContainer;
[Resolved(CanBeNull = true)] [Resolved(CanBeNull = true)]