diff --git a/osu.Game/Overlays/Options/Audio/AudioDevicesOptions.cs b/osu.Game/Overlays/Options/Audio/AudioDevicesOptions.cs index 6dfeee855d..fb0a227d08 100644 --- a/osu.Game/Overlays/Options/Audio/AudioDevicesOptions.cs +++ b/osu.Game/Overlays/Options/Audio/AudioDevicesOptions.cs @@ -5,7 +5,7 @@ namespace osu.Game.Overlays.Options.Audio public class AudioDevicesOptions : OptionsSubsection { protected override string Header => "Devices"; - + public AudioDevicesOptions() { Children = new[] diff --git a/osu.Game/Overlays/Options/Audio/AudioSection.cs b/osu.Game/Overlays/Options/Audio/AudioSection.cs index 5a7e2c31f7..af72974a10 100644 --- a/osu.Game/Overlays/Options/Audio/AudioSection.cs +++ b/osu.Game/Overlays/Options/Audio/AudioSection.cs @@ -7,7 +7,7 @@ namespace osu.Game.Overlays.Options.Audio { protected override string Header => "Audio"; public override FontAwesome Icon => FontAwesome.fa_headphones; - + public AudioSection() { Children = new Drawable[] diff --git a/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs b/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs index 5115c001ae..9bb8fb30e8 100644 --- a/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs +++ b/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs @@ -7,7 +7,7 @@ namespace osu.Game.Overlays.Options.Audio public class OffsetAdjustmentOptions : OptionsSubsection { protected override string Header => "Offset Adjustment"; - + public OffsetAdjustmentOptions() { Children = new Drawable[] diff --git a/osu.Game/Overlays/Options/Audio/VolumeOptions.cs b/osu.Game/Overlays/Options/Audio/VolumeOptions.cs index d42184e636..f9c2326123 100644 --- a/osu.Game/Overlays/Options/Audio/VolumeOptions.cs +++ b/osu.Game/Overlays/Options/Audio/VolumeOptions.cs @@ -1,12 +1,16 @@ -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.Audio { public class VolumeOptions : OptionsSubsection { - protected override string Header => "Volume"; + protected override string Header => "Volume"; + + private CheckBoxOption ignoreHitsounds; public VolumeOptions() { @@ -15,8 +19,18 @@ namespace osu.Game.Overlays.Options.Audio new SpriteText { Text = "Master: TODO slider" }, new SpriteText { Text = "Music: TODO slider" }, new SpriteText { Text = "Effect: TODO slider" }, - new BasicCheckBox { LabelText = "Ignore beatmap hitsounds" } + ignoreHitsounds = new CheckBoxOption { LabelText = "Ignore beatmap hitsounds" } }; + } + + protected override void Load(BaseGame game) + { + base.Load(game); + var osuGame = game as OsuGameBase; + if (osuGame != null) + { + ignoreHitsounds.Bindable = osuGame.Config.GetBindable(OsuConfig.IgnoreBeatmapSamples); + } } } } \ No newline at end of file diff --git a/osu.Game/Overlays/Options/CheckBoxOption.cs b/osu.Game/Overlays/Options/CheckBoxOption.cs index f6b1f37e66..3958f65be5 100644 --- a/osu.Game/Overlays/Options/CheckBoxOption.cs +++ b/osu.Game/Overlays/Options/CheckBoxOption.cs @@ -7,7 +7,7 @@ namespace osu.Game.Overlays.Options public class CheckBoxOption : BasicCheckBox { private Bindable bindable; - + public Bindable Bindable { set @@ -28,21 +28,21 @@ namespace osu.Game.Overlays.Options { State = bindable.Value ? CheckBoxState.Checked : CheckBoxState.Unchecked; } - + protected override void Dispose(bool isDisposing) { if (bindable != null) bindable.ValueChanged -= bindableValueChanged; base.Dispose(isDisposing); } - + protected override void OnChecked() { if (bindable != null) bindable.Value = true; base.OnChecked(); } - + protected override void OnUnchecked() { if (bindable != null) diff --git a/osu.Game/Overlays/Options/EditorSection.cs b/osu.Game/Overlays/Options/EditorSection.cs index ee71fec40f..be02af7c7b 100644 --- a/osu.Game/Overlays/Options/EditorSection.cs +++ b/osu.Game/Overlays/Options/EditorSection.cs @@ -1,6 +1,8 @@ using OpenTK; +using osu.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; +using osu.Game.Configuration; using osu.Game.Graphics; namespace osu.Game.Overlays.Options @@ -8,20 +10,37 @@ namespace osu.Game.Overlays.Options public class EditorSection : OptionsSection { protected override string Header => "Editor"; - public override FontAwesome Icon => FontAwesome.fa_pencil; - + public override FontAwesome Icon => FontAwesome.fa_pencil; + + private CheckBoxOption backgroundVideo, defaultSkin, snakingSliders, hitAnimations, followPoints, stacking; + public EditorSection() { content.Spacing = new Vector2(0, 5); Children = new Drawable[] { - new BasicCheckBox { LabelText = "Background video" }, - new BasicCheckBox { LabelText = "Always use default skin" }, - new BasicCheckBox { LabelText = "Snaking sliders" }, - new BasicCheckBox { LabelText = "Hit animations" }, - new BasicCheckBox { LabelText = "Follow points" }, - new BasicCheckBox { LabelText = "Stacking" }, + backgroundVideo = new CheckBoxOption { LabelText = "Background video" }, + defaultSkin = new CheckBoxOption { LabelText = "Always use default skin" }, + snakingSliders = new CheckBoxOption { LabelText = "Snaking sliders" }, + hitAnimations = new CheckBoxOption { LabelText = "Hit animations" }, + followPoints = new CheckBoxOption { LabelText = "Follow points" }, + stacking = new CheckBoxOption { LabelText = "Stacking" }, }; + } + + protected override void Load(BaseGame game) + { + base.Load(game); + var osuGame = game as OsuGameBase; + if (osuGame != null) + { + backgroundVideo.Bindable = osuGame.Config.GetBindable(OsuConfig.VideoEditor); + defaultSkin.Bindable = osuGame.Config.GetBindable(OsuConfig.EditorDefaultSkin); + snakingSliders.Bindable = osuGame.Config.GetBindable(OsuConfig.EditorSnakingSliders); + hitAnimations.Bindable = osuGame.Config.GetBindable(OsuConfig.EditorHitAnimations); + followPoints.Bindable = osuGame.Config.GetBindable(OsuConfig.EditorFollowPoints); + stacking.Bindable = osuGame.Config.GetBindable(OsuConfig.EditorStacking); + } } } } diff --git a/osu.Game/Overlays/Options/Gameplay/GameplaySection.cs b/osu.Game/Overlays/Options/Gameplay/GameplaySection.cs index d020737851..6ad157bf0b 100644 --- a/osu.Game/Overlays/Options/Gameplay/GameplaySection.cs +++ b/osu.Game/Overlays/Options/Gameplay/GameplaySection.cs @@ -7,7 +7,7 @@ namespace osu.Game.Overlays.Options.Gameplay { protected override string Header => "Gameplay"; public override FontAwesome Icon => FontAwesome.fa_circle_o; - + public GameplaySection() { Children = new Drawable[] diff --git a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs index 94a8747488..4c51bddbfa 100644 --- a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs @@ -1,13 +1,17 @@ -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.Gameplay { public class GeneralGameplayOptions : OptionsSubsection { - protected override string Header => "General"; - + protected override string Header => "General"; + + private CheckBoxOption keyOverlay, hiddenApproachCircle, scaleManiaScroll, rememberManiaScroll; + public GeneralGameplayOptions() { Children = new Drawable[] @@ -16,11 +20,24 @@ namespace osu.Game.Overlays.Options.Gameplay new SpriteText { Text = "Progress display: TODO dropdown" }, new SpriteText { Text = "Score meter type: TODO dropdown" }, new SpriteText { Text = "Score meter size: TODO slider" }, - new BasicCheckBox { LabelText = "Always show key overlay" }, - new BasicCheckBox { LabelText = "Show approach circle on first \"Hidden\" object" }, - new BasicCheckBox { LabelText = "Scale osu!mania scroll speed with BPM" }, - new BasicCheckBox { LabelText = "Remember osu!mania scroll speed per beatmap" }, + keyOverlay = new CheckBoxOption { LabelText = "Always show key overlay" }, + hiddenApproachCircle = new CheckBoxOption { LabelText = "Show approach circle on first \"Hidden\" object" }, + scaleManiaScroll = new CheckBoxOption { LabelText = "Scale osu!mania scroll speed with BPM" }, + rememberManiaScroll = new CheckBoxOption { LabelText = "Remember osu!mania scroll speed per beatmap" }, }; + } + + protected override void Load(BaseGame game) + { + base.Load(game); + var osuGame = game as OsuGameBase; + if (osuGame != null) + { + keyOverlay.Bindable = osuGame.Config.GetBindable(OsuConfig.KeyOverlay); + hiddenApproachCircle.Bindable = osuGame.Config.GetBindable(OsuConfig.HiddenShowFirstApproach); + scaleManiaScroll.Bindable = osuGame.Config.GetBindable(OsuConfig.ManiaSpeedBPMScale); + rememberManiaScroll.Bindable = osuGame.Config.GetBindable(OsuConfig.UsePerBeatmapManiaSpeed); + } } } } \ No newline at end of file diff --git a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs index d863ae29f4..b268fdcc5f 100644 --- a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs @@ -6,7 +6,7 @@ namespace osu.Game.Overlays.Options.Gameplay public class SongSelectGameplayOptions : OptionsSubsection { protected override string Header => "Song Select"; - + public SongSelectGameplayOptions() { Children = new Drawable[] diff --git a/osu.Game/Overlays/Options/General/GeneralSection.cs b/osu.Game/Overlays/Options/General/GeneralSection.cs index e08bffbd3a..29302e530b 100644 --- a/osu.Game/Overlays/Options/General/GeneralSection.cs +++ b/osu.Game/Overlays/Options/General/GeneralSection.cs @@ -7,7 +7,7 @@ namespace osu.Game.Overlays.Options.General { protected override string Header => "General"; public override FontAwesome Icon => FontAwesome.fa_gear; - + public GeneralSection() { Children = new Drawable[] diff --git a/osu.Game/Overlays/Options/General/LanguageOptions.cs b/osu.Game/Overlays/Options/General/LanguageOptions.cs index 18ff055a92..594bb9b1ec 100644 --- a/osu.Game/Overlays/Options/General/LanguageOptions.cs +++ b/osu.Game/Overlays/Options/General/LanguageOptions.cs @@ -1,6 +1,7 @@ using osu.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; +using osu.Game.Configuration; namespace osu.Game.Overlays.Options.General { @@ -8,7 +9,7 @@ namespace osu.Game.Overlays.Options.General { protected override string Header => "Language"; private CheckBoxOption showUnicode, altChatFont; - + public LanguageOptions() { Children = new Drawable[] @@ -18,15 +19,15 @@ namespace osu.Game.Overlays.Options.General altChatFont = new CheckBoxOption { LabelText = "Use alternative font for chat display" }, }; } - + protected override void Load(BaseGame game) { base.Load(game); var osuGame = game as OsuGameBase; if (osuGame != null) { - showUnicode.Bindable = osuGame.Config.GetBindable(Configuration.OsuConfig.ShowUnicode); - altChatFont.Bindable = osuGame.Config.GetBindable(Configuration.OsuConfig.AlternativeChatFont); + showUnicode.Bindable = osuGame.Config.GetBindable(OsuConfig.ShowUnicode); + altChatFont.Bindable = osuGame.Config.GetBindable(OsuConfig.AlternativeChatFont); } } } diff --git a/osu.Game/Overlays/Options/General/LoginOptions.cs b/osu.Game/Overlays/Options/General/LoginOptions.cs index 83e25f9aaf..f54084b89a 100644 --- a/osu.Game/Overlays/Options/General/LoginOptions.cs +++ b/osu.Game/Overlays/Options/General/LoginOptions.cs @@ -13,7 +13,7 @@ namespace osu.Game.Overlays.Options.General { private Container loginForm; protected override string Header => "Sign In"; - + public LoginOptions() { Children = new[] @@ -26,7 +26,7 @@ namespace osu.Game.Overlays.Options.General } }; } - + protected override void Load(BaseGame game) { base.Load(game); @@ -38,7 +38,7 @@ namespace osu.Game.Overlays.Options.General new LoginForm(osuGame.API) }; } - + class LoginForm : FlowContainer { public LoginForm(APIAccess api) diff --git a/osu.Game/Overlays/Options/General/UpdateOptions.cs b/osu.Game/Overlays/Options/General/UpdateOptions.cs index f7b33462b4..79cd3599ee 100644 --- a/osu.Game/Overlays/Options/General/UpdateOptions.cs +++ b/osu.Game/Overlays/Options/General/UpdateOptions.cs @@ -10,7 +10,7 @@ namespace osu.Game.Overlays.Options.General { private BasicStorage storage; protected override string Header => "Updates"; - + public UpdateOptions() { Children = new Drawable[] @@ -25,7 +25,7 @@ namespace osu.Game.Overlays.Options.General } }; } - + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/Overlays/Options/Graphics/DetailOptions.cs b/osu.Game/Overlays/Options/Graphics/DetailOptions.cs index 5ae7497407..14878128e3 100644 --- a/osu.Game/Overlays/Options/Graphics/DetailOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/DetailOptions.cs @@ -1,26 +1,47 @@ -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.Graphics { public class DetailOptions : OptionsSubsection { - protected override string Header => "Detail Settings"; - + protected override string Header => "Detail Settings"; + + private CheckBoxOption snakingSliders, backgroundVideo, storyboards, comboBursts, + hitLighting, shaders, softeningFilter; + public DetailOptions() { Children = new Drawable[] { - new BasicCheckBox { LabelText = "Snaking sliders" }, - new BasicCheckBox { LabelText = "Background video" }, - new BasicCheckBox { LabelText = "Storyboards" }, - new BasicCheckBox { LabelText = "Combo bursts" }, - new BasicCheckBox { LabelText = "Hit lighting" }, - new BasicCheckBox { LabelText = "Shaders" }, - new BasicCheckBox { LabelText = "Softening filter" }, + snakingSliders = new CheckBoxOption { LabelText = "Snaking sliders" }, + backgroundVideo = new CheckBoxOption { LabelText = "Background video" }, + storyboards = new CheckBoxOption { LabelText = "Storyboards" }, + comboBursts = new CheckBoxOption { LabelText = "Combo bursts" }, + hitLighting = new CheckBoxOption { LabelText = "Hit lighting" }, + shaders = new CheckBoxOption { LabelText = "Shaders" }, + softeningFilter = new CheckBoxOption { LabelText = "Softening filter" }, new SpriteText { Text = "Screenshot format TODO: dropdown" } }; + } + + protected override void Load(BaseGame game) + { + base.Load(game); + var osuGame = game as OsuGameBase; + if (osuGame != null) + { + snakingSliders.Bindable = osuGame.Config.GetBindable(OsuConfig.SnakingSliders); + backgroundVideo.Bindable = osuGame.Config.GetBindable(OsuConfig.Video); + storyboards.Bindable = osuGame.Config.GetBindable(OsuConfig.ShowStoryboard); + comboBursts.Bindable = osuGame.Config.GetBindable(OsuConfig.ComboBurst); + hitLighting.Bindable = osuGame.Config.GetBindable(OsuConfig.HitLighting); + shaders.Bindable = osuGame.Config.GetBindable(OsuConfig.Bloom); + softeningFilter.Bindable = osuGame.Config.GetBindable(OsuConfig.BloomSoftening); + } } } } \ No newline at end of file diff --git a/osu.Game/Overlays/Options/Graphics/GraphicsSection.cs b/osu.Game/Overlays/Options/Graphics/GraphicsSection.cs index 64b5ef4fa1..1e2d8da985 100644 --- a/osu.Game/Overlays/Options/Graphics/GraphicsSection.cs +++ b/osu.Game/Overlays/Options/Graphics/GraphicsSection.cs @@ -7,7 +7,7 @@ namespace osu.Game.Overlays.Options.Graphics { protected override string Header => "Graphics"; public override FontAwesome Icon => FontAwesome.fa_laptop; - + public GraphicsSection() { Children = new Drawable[] diff --git a/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs b/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs index 72031cc757..575d290286 100644 --- a/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs @@ -1,25 +1,40 @@ -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.Graphics { public class LayoutOptions : OptionsSubsection { - protected override string Header => "Layout"; - + protected override string Header => "Layout"; + + private CheckBoxOption fullscreen, letterboxing; + public LayoutOptions() { Children = new Drawable[] { new SpriteText { Text = "Resolution: TODO dropdown" }, - new BasicCheckBox { LabelText = "Fullscreen mode" }, - new BasicCheckBox { LabelText = "Letterboxing" }, + fullscreen = new CheckBoxOption { LabelText = "Fullscreen mode" }, + letterboxing = new CheckBoxOption { LabelText = "Letterboxing" }, new SpriteText { Text = "Horizontal position" }, new SpriteText { Text = "TODO: slider" }, new SpriteText { Text = "Vertical position" }, new SpriteText { Text = "TODO: slider" }, }; + } + + protected override void Load(BaseGame game) + { + base.Load(game); + var osuGame = game as OsuGameBase; + if (osuGame != null) + { + fullscreen.Bindable = osuGame.Config.GetBindable(OsuConfig.Fullscreen); + letterboxing.Bindable = osuGame.Config.GetBindable(OsuConfig.Letterboxing); + } } } } \ No newline at end of file diff --git a/osu.Game/Overlays/Options/Graphics/MainMenuOptions.cs b/osu.Game/Overlays/Options/Graphics/MainMenuOptions.cs index 0827402dc6..06429f1e61 100644 --- a/osu.Game/Overlays/Options/Graphics/MainMenuOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/MainMenuOptions.cs @@ -1,21 +1,39 @@ -using osu.Framework.Graphics.UserInterface; +using osu.Framework; +using osu.Framework.Graphics.UserInterface; +using osu.Game.Configuration; namespace osu.Game.Overlays.Options.Graphics { public class MainMenuOptions : OptionsSubsection { - protected override string Header => "Main Menu"; - + protected override string Header => "Main Menu"; + + private CheckBoxOption snow, parallax, tips, voices, musicTheme; + public MainMenuOptions() { Children = new[] { - new BasicCheckBox { LabelText = "Snow" }, - new BasicCheckBox { LabelText = "Parallax" }, - new BasicCheckBox { LabelText = "Menu tips" }, - new BasicCheckBox { LabelText = "Interface voices" }, - new BasicCheckBox { LabelText = "osu! music theme" }, + snow = new CheckBoxOption { LabelText = "Snow" }, + parallax = new CheckBoxOption { LabelText = "Parallax" }, + tips = new CheckBoxOption { LabelText = "Menu tips" }, + voices = new CheckBoxOption { LabelText = "Interface voices" }, + musicTheme = new CheckBoxOption { LabelText = "osu! music theme" }, }; + } + + protected override void Load(BaseGame game) + { + base.Load(game); + var osuGame = game as OsuGameBase; + if (osuGame != null) + { + snow.Bindable = osuGame.Config.GetBindable(OsuConfig.MenuSnow); + parallax.Bindable = osuGame.Config.GetBindable(OsuConfig.MenuParallax); + tips.Bindable = osuGame.Config.GetBindable(OsuConfig.ShowMenuTips); + voices.Bindable = osuGame.Config.GetBindable(OsuConfig.MenuVoice); + musicTheme.Bindable = osuGame.Config.GetBindable(OsuConfig.MenuMusic); + } } } } \ No newline at end of file diff --git a/osu.Game/Overlays/Options/Graphics/RendererOptions.cs b/osu.Game/Overlays/Options/Graphics/RendererOptions.cs index 1a27c1718d..411bff4a81 100644 --- a/osu.Game/Overlays/Options/Graphics/RendererOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/RendererOptions.cs @@ -1,23 +1,39 @@ -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.Graphics { public class RendererOptions : OptionsSubsection { - protected override string Header => "Renderer"; - + protected override string Header => "Renderer"; + + private CheckBoxOption fpsCounter, reduceDroppedFrames, detectPerformanceIssues; + public RendererOptions() { // NOTE: Compatability mode omitted Children = new Drawable[] { new SpriteText { Text = "Frame limiter: TODO dropdown" }, - new BasicCheckBox { LabelText = "Show FPS counter" }, - new BasicCheckBox { LabelText = "Reduce dropped frames" }, - new BasicCheckBox { LabelText = "Detect performance issues" }, + fpsCounter = new CheckBoxOption { LabelText = "Show FPS counter" }, + reduceDroppedFrames = new CheckBoxOption { LabelText = "Reduce dropped frames" }, + detectPerformanceIssues = new CheckBoxOption { LabelText = "Detect performance issues" }, }; + } + + protected override void Load(BaseGame game) + { + base.Load(game); + var osuGame = game as OsuGameBase; + if (osuGame != null) + { + fpsCounter.Bindable = osuGame.Config.GetBindable(OsuConfig.FpsCounter); + reduceDroppedFrames.Bindable = osuGame.Config.GetBindable(OsuConfig.ForceFrameFlush); + detectPerformanceIssues.Bindable = osuGame.Config.GetBindable(OsuConfig.DetectPerformanceIssues); + } } } } \ No newline at end of file diff --git a/osu.Game/Overlays/Options/Graphics/SongSelectGraphicsOptions.cs b/osu.Game/Overlays/Options/Graphics/SongSelectGraphicsOptions.cs index 003afe8a0a..044d9bfe96 100644 --- a/osu.Game/Overlays/Options/Graphics/SongSelectGraphicsOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/SongSelectGraphicsOptions.cs @@ -1,17 +1,31 @@ -using osu.Framework.Graphics.UserInterface; +using osu.Framework; +using osu.Framework.Graphics.UserInterface; +using osu.Game.Configuration; namespace osu.Game.Overlays.Options.Graphics { public class SongSelectGraphicsOptions : OptionsSubsection { - protected override string Header => "Song Select"; + protected override string Header => "Song Select"; + + private CheckBoxOption showThumbs; public SongSelectGraphicsOptions() { Children = new[] { - new BasicCheckBox { LabelText = "Show thumbnails" } + showThumbs = new CheckBoxOption { LabelText = "Show thumbnails" } }; + } + + protected override void Load(BaseGame game) + { + base.Load(game); + var osuGame = game as OsuGameBase; + if (osuGame != null) + { + showThumbs.Bindable = osuGame.Config.GetBindable(OsuConfig.SongSelectThumbnails); + } } } } \ No newline at end of file diff --git a/osu.Game/Overlays/Options/Input/InputSection.cs b/osu.Game/Overlays/Options/Input/InputSection.cs index ca722b1a08..6e19e8a283 100644 --- a/osu.Game/Overlays/Options/Input/InputSection.cs +++ b/osu.Game/Overlays/Options/Input/InputSection.cs @@ -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[] diff --git a/osu.Game/Overlays/Options/Input/KeyboardOptions.cs b/osu.Game/Overlays/Options/Input/KeyboardOptions.cs index 71e41cad39..cea5cf3b7a 100644 --- a/osu.Game/Overlays/Options/Input/KeyboardOptions.cs +++ b/osu.Game/Overlays/Options/Input/KeyboardOptions.cs @@ -6,7 +6,7 @@ namespace osu.Game.Overlays.Options.Input public class KeyboardOptions : OptionsSubsection { protected override string Header => "Keyboard"; - + public KeyboardOptions() { Children = new Drawable[] diff --git a/osu.Game/Overlays/Options/Input/MouseOptions.cs b/osu.Game/Overlays/Options/Input/MouseOptions.cs index 64ac31c57b..419aecc675 100644 --- a/osu.Game/Overlays/Options/Input/MouseOptions.cs +++ b/osu.Game/Overlays/Options/Input/MouseOptions.cs @@ -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(OsuConfig.RawInput); + mapRawInput.Bindable = osuGame.Config.GetBindable(OsuConfig.AbsoluteToOsuWindow); + disableWheel.Bindable = osuGame.Config.GetBindable(OsuConfig.MouseDisableWheel); + disableButtons.Bindable = osuGame.Config.GetBindable(OsuConfig.MouseDisableButtons); + enableRipples.Bindable = osuGame.Config.GetBindable(OsuConfig.CursorRipple); + } } } } \ No newline at end of file diff --git a/osu.Game/Overlays/Options/Input/OtherInputOptions.cs b/osu.Game/Overlays/Options/Input/OtherInputOptions.cs index 4fef737f37..a24009454b 100644 --- a/osu.Game/Overlays/Options/Input/OtherInputOptions.cs +++ b/osu.Game/Overlays/Options/Input/OtherInputOptions.cs @@ -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(OsuConfig.Tablet); + wiimoteSupport.Bindable = osuGame.Config.GetBindable(OsuConfig.Wiimote); + } } } } diff --git a/osu.Game/Overlays/Options/MaintenanceSection.cs b/osu.Game/Overlays/Options/MaintenanceSection.cs index aa4c74c605..ba9b3b7e56 100644 --- a/osu.Game/Overlays/Options/MaintenanceSection.cs +++ b/osu.Game/Overlays/Options/MaintenanceSection.cs @@ -10,7 +10,7 @@ namespace osu.Game.Overlays.Options { protected override string Header => "Maintenance"; public override FontAwesome Icon => FontAwesome.fa_wrench; - + public MaintenanceSection() { content.Spacing = new Vector2(0, 5); diff --git a/osu.Game/Overlays/Options/Online/InGameChatOptions.cs b/osu.Game/Overlays/Options/Online/InGameChatOptions.cs index 08545dfc08..29316b60fc 100644 --- a/osu.Game/Overlays/Options/Online/InGameChatOptions.cs +++ b/osu.Game/Overlays/Options/Online/InGameChatOptions.cs @@ -1,26 +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.Online { public class InGameChatOptions : OptionsSubsection { - protected override string Header => "In-game Chat"; - + protected override string Header => "In-game Chat"; + + private CheckBoxOption filterWords, filterForeign, logPMs, blockPMs; + public InGameChatOptions() { Children = new Drawable[] { - new BasicCheckBox { LabelText = "Filter offensive words" }, - new BasicCheckBox { LabelText = "Filter foreign characters" }, - new BasicCheckBox { LabelText = "Log private messages" }, - new BasicCheckBox { LabelText = "Block private messages from non-friends" }, + filterWords = new CheckBoxOption { LabelText = "Filter offensive words" }, + filterForeign = new CheckBoxOption { LabelText = "Filter foreign characters" }, + logPMs = new CheckBoxOption { LabelText = "Log private messages" }, + blockPMs = new CheckBoxOption { LabelText = "Block private messages from non-friends" }, new SpriteText { Text = "Chat ignore list (space-seperated list)" }, new TextBox { Height = 20, RelativeSizeAxes = Axes.X }, new SpriteText { Text = "Chat highlight words (space-seperated list)" }, new TextBox { Height = 20, RelativeSizeAxes = Axes.X }, }; + } + + protected override void Load(BaseGame game) + { + base.Load(game); + var osuGame = game as OsuGameBase; + if (osuGame != null) + { + filterWords.Bindable = osuGame.Config.GetBindable(OsuConfig.ChatFilter); + filterForeign.Bindable = osuGame.Config.GetBindable(OsuConfig.ChatRemoveForeign); + logPMs.Bindable = osuGame.Config.GetBindable(OsuConfig.LogPrivateMessages); + blockPMs.Bindable = osuGame.Config.GetBindable(OsuConfig.BlockNonFriendPM); + } } } } \ No newline at end of file diff --git a/osu.Game/Overlays/Options/Online/NotificationsOptions.cs b/osu.Game/Overlays/Options/Online/NotificationsOptions.cs index 3960560190..0520579f6e 100644 --- a/osu.Game/Overlays/Options/Online/NotificationsOptions.cs +++ b/osu.Game/Overlays/Options/Online/NotificationsOptions.cs @@ -1,23 +1,43 @@ -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.Online { public class NotificationsOptions : OptionsSubsection { protected override string Header => "Notifications"; + + private CheckBoxOption chatTicker, notifyMention, notifyChat, audibleNotification, + notificationsDuringGameplay, notifyFriendStatus; public NotificationsOptions() { Children = new Drawable[] { - new BasicCheckBox { LabelText = "Enable chat ticker" }, - new BasicCheckBox { LabelText = "Show a notification popup when someone says your name" }, - new BasicCheckBox { LabelText = "Show chat message notifications" }, - new BasicCheckBox { LabelText = "Play a sound when someone says your name" }, - new BasicCheckBox { LabelText = "Show notification popups instantly during gameplay" }, - new BasicCheckBox { LabelText = "Show notification popups when friends change status" }, + chatTicker = new CheckBoxOption { LabelText = "Enable chat ticker" }, + notifyMention = new CheckBoxOption { LabelText = "Show a notification popup when someone says your name" }, + notifyChat = new CheckBoxOption { LabelText = "Show chat message notifications" }, + audibleNotification = new CheckBoxOption { LabelText = "Play a sound when someone says your name" }, + notificationsDuringGameplay = new CheckBoxOption { LabelText = "Show notification popups instantly during gameplay" }, + notifyFriendStatus = new CheckBoxOption { LabelText = "Show notification popups when friends change status" }, }; } + + protected override void Load(BaseGame game) + { + base.Load(game); + var osuGame = game as OsuGameBase; + if (osuGame != null) + { + chatTicker.Bindable = osuGame.Config.GetBindable(OsuConfig.Ticker); + notifyMention.Bindable = osuGame.Config.GetBindable(OsuConfig.ChatHighlightName); + notifyChat.Bindable = osuGame.Config.GetBindable(OsuConfig.ChatMessageNotification); + audibleNotification.Bindable = osuGame.Config.GetBindable(OsuConfig.ChatAudibleHighlight); + notificationsDuringGameplay.Bindable = osuGame.Config.GetBindable(OsuConfig.PopupDuringGameplay); + notifyFriendStatus.Bindable = osuGame.Config.GetBindable(OsuConfig.NotifyFriends); + } + } } } \ No newline at end of file diff --git a/osu.Game/Overlays/Options/Online/OnlineIntegrationOptions.cs b/osu.Game/Overlays/Options/Online/OnlineIntegrationOptions.cs index cd2516dd79..4b50914b7e 100644 --- a/osu.Game/Overlays/Options/Online/OnlineIntegrationOptions.cs +++ b/osu.Game/Overlays/Options/Online/OnlineIntegrationOptions.cs @@ -1,21 +1,38 @@ -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.Online { public class OnlineIntegrationOptions : OptionsSubsection { - protected override string Header => "Integration"; - + protected override string Header => "Integration"; + + private CheckBoxOption yahoo, msn, autoDirect, noVideo; + public OnlineIntegrationOptions() { Children = new Drawable[] { - new BasicCheckBox { LabelText = "Integrate with Yahoo! status display" }, - new BasicCheckBox { LabelText = "Integrate with MSN Live status display" }, - new BasicCheckBox { LabelText = "Automatically start osu!direct downloads" }, - new BasicCheckBox { LabelText = "Prefer no-video downloads" }, + yahoo = new CheckBoxOption { LabelText = "Integrate with Yahoo! status display" }, + msn = new CheckBoxOption { LabelText = "Integrate with MSN Live status display" }, + autoDirect = new CheckBoxOption { LabelText = "Automatically start osu!direct downloads" }, + noVideo = new CheckBoxOption { LabelText = "Prefer no-video downloads" }, }; + } + + protected override void Load(BaseGame game) + { + base.Load(game); + var osuGame = game as OsuGameBase; + if (osuGame != null) + { + yahoo.Bindable = osuGame.Config.GetBindable(OsuConfig.YahooIntegration); + msn.Bindable = osuGame.Config.GetBindable(OsuConfig.MsnIntegration); + autoDirect.Bindable = osuGame.Config.GetBindable(OsuConfig.AutomaticDownload); + noVideo.Bindable = osuGame.Config.GetBindable(OsuConfig.AutomaticDownloadNoVideo); + } } } } \ No newline at end of file diff --git a/osu.Game/Overlays/Options/Online/OnlineSection.cs b/osu.Game/Overlays/Options/Online/OnlineSection.cs index 8524f33042..3c6e6b8a67 100644 --- a/osu.Game/Overlays/Options/Online/OnlineSection.cs +++ b/osu.Game/Overlays/Options/Online/OnlineSection.cs @@ -7,7 +7,7 @@ namespace osu.Game.Overlays.Options.Online { protected override string Header => "Online"; public override FontAwesome Icon => FontAwesome.fa_globe; - + public OnlineSection() { Children = new Drawable[] diff --git a/osu.Game/Overlays/Options/Online/PrivacyOptions.cs b/osu.Game/Overlays/Options/Online/PrivacyOptions.cs index 2179d694ee..35880c5627 100644 --- a/osu.Game/Overlays/Options/Online/PrivacyOptions.cs +++ b/osu.Game/Overlays/Options/Online/PrivacyOptions.cs @@ -1,20 +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.Online { public class PrivacyOptions : OptionsSubsection { protected override string Header => "Privacy"; + + private CheckBoxOption shareCity, allowInvites; public PrivacyOptions() { Children = new Drawable[] { - new BasicCheckBox { LabelText = "Share your city location with others" }, - new BasicCheckBox { LabelText = "Allow multiplayer game invites from all users" }, - new BasicCheckBox { LabelText = "Block private messages from non-friends" }, + shareCity = new CheckBoxOption { LabelText = "Share your city location with others" }, + allowInvites = new CheckBoxOption { LabelText = "Allow multiplayer game invites from all users" }, }; } + + protected override void Load(BaseGame game) + { + base.Load(game); + var osuGame = game as OsuGameBase; + if (osuGame != null) + { + shareCity.Bindable = osuGame.Config.GetBindable(OsuConfig.DisplayCityLocation); + allowInvites.Bindable = osuGame.Config.GetBindable(OsuConfig.AllowPublicInvites); + } + } } } \ No newline at end of file diff --git a/osu.Game/Overlays/Options/OptionsSubsection.cs b/osu.Game/Overlays/Options/OptionsSubsection.cs index 8dc9e1d4be..09db27c54f 100644 --- a/osu.Game/Overlays/Options/OptionsSubsection.cs +++ b/osu.Game/Overlays/Options/OptionsSubsection.cs @@ -9,9 +9,9 @@ namespace osu.Game.Overlays.Options { private Container content; protected override Container Content => content; - + protected abstract string Header { get; } - + public OptionsSubsection() { RelativeSizeAxes = Axes.X; diff --git a/osu.Game/Overlays/Options/SkinSection.cs b/osu.Game/Overlays/Options/SkinSection.cs index ca80aa891b..12f55aafd1 100644 --- a/osu.Game/Overlays/Options/SkinSection.cs +++ b/osu.Game/Overlays/Options/SkinSection.cs @@ -1,7 +1,9 @@ using OpenTK; +using osu.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; +using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; @@ -10,7 +12,9 @@ namespace osu.Game.Overlays.Options public class SkinSection : OptionsSection { protected override string Header => "Skin"; - public override FontAwesome Icon => FontAwesome.fa_paint_brush; + public override FontAwesome Icon => FontAwesome.fa_paint_brush; + + private CheckBoxOption ignoreSkins, useSkinSoundSamples, useTaikoSkin, useSkinCursor, autoCursorSize; public SkinSection() { @@ -34,13 +38,27 @@ namespace osu.Game.Overlays.Options RelativeSizeAxes = Axes.X, Text = "Export as .osk", }, - new BasicCheckBox { LabelText = "Ignore all beatmap skins" }, - new BasicCheckBox { LabelText = "Use skin's sound samples" }, - new BasicCheckBox { LabelText = "Use Taiko skin for Taiko mode" }, - new BasicCheckBox { LabelText = "Always use skin cursor" }, + ignoreSkins = new CheckBoxOption { LabelText = "Ignore all beatmap skins" }, + useSkinSoundSamples = new CheckBoxOption { LabelText = "Use skin's sound samples" }, + useTaikoSkin = new CheckBoxOption { LabelText = "Use Taiko skin for Taiko mode" }, + useSkinCursor = new CheckBoxOption { LabelText = "Always use skin cursor" }, new SpriteText { Text = "Cursor size: TODO slider" }, - new BasicCheckBox { LabelText = "Automatic cursor size" }, + autoCursorSize = new CheckBoxOption { LabelText = "Automatic cursor size" }, }; + } + + protected override void Load(BaseGame game) + { + base.Load(game); + var osuGame = game as OsuGameBase; + if (osuGame != null) + { + ignoreSkins.Bindable = osuGame.Config.GetBindable(OsuConfig.IgnoreBeatmapSkins); + useSkinSoundSamples.Bindable = osuGame.Config.GetBindable(OsuConfig.SkinSamples); + useTaikoSkin.Bindable = osuGame.Config.GetBindable(OsuConfig.UseTaikoSkin); + useSkinCursor.Bindable = osuGame.Config.GetBindable(OsuConfig.UseSkinCursor); + autoCursorSize.Bindable = osuGame.Config.GetBindable(OsuConfig.AutomaticCursorSizing); + } } } } \ No newline at end of file