Wire up all of the boolean options

This commit is contained in:
Drew DeVault
2016-11-08 22:38:40 -05:00
parent 485f60b418
commit 3ad633f363
31 changed files with 374 additions and 120 deletions

View File

@ -7,7 +7,7 @@ namespace osu.Game.Overlays.Options.Input
{
protected override string Header => "Input";
public override FontAwesome Icon => FontAwesome.fa_keyboard_o;
public InputSection()
{
Children = new Drawable[]

View File

@ -6,7 +6,7 @@ namespace osu.Game.Overlays.Options.Input
public class KeyboardOptions : OptionsSubsection
{
protected override string Header => "Keyboard";
public KeyboardOptions()
{
Children = new Drawable[]

View File

@ -1,25 +1,43 @@
using osu.Framework.Graphics;
using osu.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Input
{
public class MouseOptions : OptionsSubsection
{
protected override string Header => "Mouse";
protected override string Header => "Mouse";
private CheckBoxOption rawInput, mapRawInput, disableWheel, disableButtons, enableRipples;
public MouseOptions()
{
Children = new Drawable[]
{
new SpriteText { Text = "Sensitivity: TODO slider" },
new BasicCheckBox { LabelText = "Raw input" },
new BasicCheckBox { LabelText = "Map absolute raw input to the osu! window" },
rawInput = new CheckBoxOption { LabelText = "Raw input" },
mapRawInput = new CheckBoxOption { LabelText = "Map absolute raw input to the osu! window" },
new SpriteText { Text = "Confine mouse cursor: TODO dropdown" },
new BasicCheckBox { LabelText = "Disable mouse wheel in play mode" },
new BasicCheckBox { LabelText = "Disable mouse buttons in play mode" },
new BasicCheckBox { LabelText = "Cursor ripples" },
disableWheel = new CheckBoxOption { LabelText = "Disable mouse wheel in play mode" },
disableButtons = new CheckBoxOption { LabelText = "Disable mouse buttons in play mode" },
enableRipples = new CheckBoxOption { LabelText = "Cursor ripples" },
};
}
protected override void Load(BaseGame game)
{
base.Load(game);
var osuGame = game as OsuGameBase;
if (osuGame != null)
{
rawInput.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.RawInput);
mapRawInput.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.AbsoluteToOsuWindow);
disableWheel.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.MouseDisableWheel);
disableButtons.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.MouseDisableButtons);
enableRipples.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.CursorRipple);
}
}
}
}

View File

@ -1,19 +1,34 @@
using osu.Framework.Graphics;
using osu.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Input
{
public class OtherInputOptions : OptionsSubsection
{
protected override string Header => "Other";
protected override string Header => "Other";
private CheckBoxOption tabletSupport, wiimoteSupport;
public OtherInputOptions()
{
Children = new Drawable[]
{
new BasicCheckBox { LabelText = "OS TabletPC support" },
new BasicCheckBox { LabelText = "Wiimote/TaTaCon Drum Support" },
tabletSupport = new CheckBoxOption { LabelText = "OS TabletPC support" },
wiimoteSupport = new CheckBoxOption { LabelText = "Wiimote/TaTaCon Drum Support" },
};
}
protected override void Load(BaseGame game)
{
base.Load(game);
var osuGame = game as OsuGameBase;
if (osuGame != null)
{
tabletSupport.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.Tablet);
wiimoteSupport.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.Wiimote);
}
}
}
}