mirror of
https://github.com/ppy/osu
synced 2024-12-27 01:12:45 +00:00
Add keybind to disable mouse buttons
This commit is contained in:
parent
420e50b6da
commit
d4ada3000c
@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Configuration.Tracking;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Screens.Select;
|
||||
@ -95,6 +96,11 @@ namespace osu.Game.Configuration
|
||||
public OsuConfigManager(Storage storage) : base(storage)
|
||||
{
|
||||
}
|
||||
|
||||
public override TrackedSettings CreateTrackedSettings() => new TrackedSettings
|
||||
{
|
||||
new TrackedSetting<bool>(OsuSetting.MouseDisableButtons, v => new SettingDescription(!v, "gameplay mouse buttons", v ? "disabled" : "enabled"))
|
||||
};
|
||||
}
|
||||
|
||||
public enum OsuSetting
|
||||
|
@ -26,7 +26,8 @@ namespace osu.Game.Input.Bindings
|
||||
{
|
||||
new KeyBinding(InputKey.F8, GlobalAction.ToggleChat),
|
||||
new KeyBinding(InputKey.F9, GlobalAction.ToggleSocial),
|
||||
new KeyBinding(InputKey.F12,GlobalAction.TakeScreenshot),
|
||||
new KeyBinding(InputKey.F10, GlobalAction.ToggleMouseButtons),
|
||||
new KeyBinding(InputKey.F12, GlobalAction.TakeScreenshot),
|
||||
|
||||
new KeyBinding(new[] { InputKey.Control, InputKey.Alt, InputKey.R }, GlobalAction.ResetInputSettings),
|
||||
new KeyBinding(new[] { InputKey.Control, InputKey.T }, GlobalAction.ToggleToolbar),
|
||||
@ -75,6 +76,8 @@ namespace osu.Game.Input.Bindings
|
||||
[Description("Quick Retry (Hold)")]
|
||||
QuickRetry,
|
||||
|
||||
[Description("Toggle gameplay mouse buttons")]
|
||||
ToggleMouseButtons,
|
||||
[Description("Take screenshot")]
|
||||
TakeScreenshot
|
||||
}
|
||||
|
@ -466,6 +466,9 @@ namespace osu.Game
|
||||
case GlobalAction.ToggleDirect:
|
||||
direct.ToggleVisibility();
|
||||
return true;
|
||||
case GlobalAction.ToggleMouseButtons:
|
||||
LocalConfig.Set(OsuSetting.MouseDisableButtons, !LocalConfig.Get<bool>(OsuSetting.MouseDisableButtons));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -14,6 +14,7 @@ using osu.Game.Graphics;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
@ -116,9 +117,10 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(FrameworkConfigManager frameworkConfig)
|
||||
private void load(FrameworkConfigManager frameworkConfig, OsuConfigManager osuConfig)
|
||||
{
|
||||
BeginTracking(this, frameworkConfig);
|
||||
BeginTracking(this, osuConfig);
|
||||
}
|
||||
|
||||
private readonly Dictionary<(object, IConfigManager), TrackedSettings> trackedConfigManagers = new Dictionary<(object, IConfigManager), TrackedSettings>();
|
||||
|
Loading…
Reference in New Issue
Block a user