1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 21:02:54 +08:00

Add support for framework-level mouse confining.

This commit is contained in:
Dean Herbert 2017-05-02 17:45:42 +09:00
parent bef15fe637
commit 1b0f353af3
5 changed files with 14 additions and 25 deletions

View File

@ -29,7 +29,7 @@ namespace osu.Desktop.VisualTests
host.DrawThread.InactiveHz = host.DrawThread.ActiveHz;
host.InputThread.InactiveHz = host.InputThread.ActiveHz;
host.Window.CursorState = CursorState.Hidden;
host.Window.CursorState |= CursorState.Hidden;
}
}
}

View File

@ -43,7 +43,7 @@ namespace osu.Desktop
var desktopWindow = host.Window as DesktopGameWindow;
if (desktopWindow != null)
{
desktopWindow.CursorState = CursorState.Hidden;
desktopWindow.CursorState |= CursorState.Hidden;
desktopWindow.Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
desktopWindow.Title = Name;

View File

@ -1,12 +0,0 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Configuration
{
public enum ConfineMouseMode
{
Never,
Fullscreen,
Always
}
}

View File

@ -2,7 +2,9 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Input;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
@ -13,44 +15,44 @@ namespace osu.Game.Overlays.Options.Sections.Input
protected override string Header => "Mouse";
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
private void load(OsuConfigManager osuConfig, FrameworkConfigManager config)
{
Children = new Drawable[]
{
new OptionSlider<double, SensitivitySlider>
{
LabelText = "Sensitivity",
Bindable = config.GetBindable<double>(OsuConfig.MouseSpeed)
Bindable = osuConfig.GetBindable<double>(OsuConfig.MouseSpeed)
},
new OsuCheckbox
{
LabelText = "Raw input",
Bindable = config.GetBindable<bool>(OsuConfig.RawInput)
Bindable = osuConfig.GetBindable<bool>(OsuConfig.RawInput)
},
new OsuCheckbox
{
LabelText = "Map absolute raw input to the osu! window",
Bindable = config.GetBindable<bool>(OsuConfig.AbsoluteToOsuWindow)
Bindable = osuConfig.GetBindable<bool>(OsuConfig.AbsoluteToOsuWindow)
},
new OptionEnumDropdown<ConfineMouseMode>
{
LabelText = "Confine mouse cursor",
Bindable = config.GetBindable<ConfineMouseMode>(OsuConfig.ConfineMouse),
Bindable = config.GetBindable<ConfineMouseMode>(FrameworkConfig.ConfineMouseMode),
},
new OsuCheckbox
{
LabelText = "Disable mouse wheel in play mode",
Bindable = config.GetBindable<bool>(OsuConfig.MouseDisableWheel)
LabelText = "Disable mouse wheel during gameplay",
Bindable = osuConfig.GetBindable<bool>(OsuConfig.MouseDisableWheel)
},
new OsuCheckbox
{
LabelText = "Disable mouse buttons in play mode",
Bindable = config.GetBindable<bool>(OsuConfig.MouseDisableButtons)
LabelText = "Disable mouse buttons during gameplay",
Bindable = osuConfig.GetBindable<bool>(OsuConfig.MouseDisableButtons)
},
new OsuCheckbox
{
LabelText = "Cursor ripples",
Bindable = config.GetBindable<bool>(OsuConfig.CursorRipple)
Bindable = osuConfig.GetBindable<bool>(OsuConfig.CursorRipple)
},
};
}

View File

@ -385,7 +385,6 @@
<Compile Include="Configuration\ScoreMeterType.cs" />
<Compile Include="Configuration\ReleaseStream.cs" />
<Compile Include="Configuration\ScreenshotFormat.cs" />
<Compile Include="Configuration\ConfineMouseMode.cs" />
<Compile Include="Graphics\OsuColour.cs" />
<Compile Include="Screens\Select\FilterControl.cs" />
<Compile Include="Screens\Select\SearchTextBox.cs" />