1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 22:27:25 +08:00

Merge branch 'master' into unix-nuget-issue

This commit is contained in:
Dean Herbert 2017-06-09 21:07:37 +09:00 committed by GitHub
commit 50e6bdf773
4 changed files with 35 additions and 8 deletions

@ -1 +1 @@
Subproject commit 7131c54ea0a76ea03565ca93680487930c1c158a
Subproject commit 9a1de5dc43158db5b4fe24ea74bc3109cb46c05f

View File

@ -77,8 +77,10 @@ namespace osu.Game
public void ToggleDirect() => direct.ToggleVisibility();
[BackgroundDependencyLoader]
private void load()
private void load(FrameworkConfigManager frameworkConfig)
{
this.frameworkConfig = frameworkConfig;
if (!Host.IsPrimaryInstance)
{
Logger.Log(@"osu! does not support multiple running instances.", LoggingTarget.Runtime, LogLevel.Error);
@ -259,6 +261,19 @@ namespace osu.Game
{
switch (args.Key)
{
case Key.R:
if (state.Keyboard.AltPressed)
{
var sensitivity = frameworkConfig.GetBindable<double>(FrameworkSetting.CursorSensitivity);
sensitivity.Disabled = false;
sensitivity.Value = 1;
sensitivity.Disabled = true;
frameworkConfig.Set(FrameworkSetting.ActiveInputHandlers, string.Empty);
return true;
}
break;
case Key.T:
Toolbar.ToggleVisibility();
return true;
@ -284,6 +299,7 @@ namespace osu.Game
private Container overlayContent;
private OsuScreen currentScreen;
private FrameworkConfigManager frameworkConfig;
private void screenChanged(Screen newScreen)
{

View File

@ -125,6 +125,14 @@ namespace osu.Game.Overlays
trackSetting(frameworkConfig.GetBindable<int>(FrameworkSetting.Width), v => displayResolution());
trackSetting(frameworkConfig.GetBindable<int>(FrameworkSetting.Height), v => displayResolution());
trackSetting(frameworkConfig.GetBindable<double>(FrameworkSetting.CursorSensitivity), v => display(v, "Cursor Sensitivity", v.ToString(@"0.##x"), "Ctrl+Alt+R to reset"));
trackSetting(frameworkConfig.GetBindable<string>(FrameworkSetting.ActiveInputHandlers),
delegate (string v)
{
bool raw = v.Contains("Raw");
display(raw, "Raw Input", raw ? "enabled" : "disabled", "Ctrl+Alt+R to reset");
});
trackSetting(frameworkConfig.GetBindable<WindowMode>(FrameworkSetting.WindowMode), v => display(v, "Screen Mode", v.ToString(), "Alt+Enter"));
}

View File

@ -21,9 +21,6 @@ namespace osu.Game.Overlays.Settings.Sections.Input
[BackgroundDependencyLoader]
private void load(OsuConfigManager osuConfig, FrameworkConfigManager config)
{
activeInputHandlers = config.GetBindable<string>(FrameworkSetting.ActiveInputHandlers);
rawInputToggle.Value = activeInputHandlers.Value.Contains("Raw");
Children = new Drawable[]
{
new SettingsCheckbox
@ -62,11 +59,17 @@ namespace osu.Game.Overlays.Settings.Sections.Input
activeInputHandlers.Value = enabled ?
activeInputHandlers.Value.Replace(standard_mouse_handler, raw_mouse_handler) :
activeInputHandlers.Value.Replace(raw_mouse_handler, standard_mouse_handler);
sensitivity.Bindable.Disabled = !enabled;
};
rawInputToggle.TriggerChange();
activeInputHandlers = config.GetBindable<string>(FrameworkSetting.ActiveInputHandlers);
activeInputHandlers.ValueChanged += handlers =>
{
bool raw = handlers.Contains("Raw");
rawInputToggle.Value = raw;
sensitivity.Bindable.Disabled = !raw;
};
activeInputHandlers.TriggerChange();
}
private class SensitivitySetting : SettingsSlider<double, SensitivitySlider>