From 3aefa4d6a5602e37ca26cfa98f8f8188873c6308 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 30 Nov 2016 10:32:07 -0500 Subject: [PATCH] Wire up remaining sliders, except for ints --- osu.Game/Configuration/OsuConfigManager.cs | 1 + .../Options/Audio/OffsetAdjustmentOptions.cs | 37 ++++--- .../Gameplay/GeneralGameplayOptions.cs | 104 ++++++++++-------- .../Gameplay/SongSelectGameplayOptions.cs | 50 +++++++-- .../Options/Graphics/LayoutOptions.cs | 18 ++- osu.Game/Overlays/Options/OptionsSlider.cs | 8 +- 6 files changed, 143 insertions(+), 75 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 8e5fbfad42..ef95a3ac3f 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -96,6 +96,7 @@ namespace osu.Game.Configuration Set(OsuConfig.MouseDisableWheel, false); Set(OsuConfig.MouseSpeed, 1, 0.4, 6); Set(OsuConfig.Offset, 0, -300, 300); + Set(OsuConfig.ScoreMeterScale, 1, 0.5, 2); //Set(OsuConfig.ScoreMeterScale, 1, 0.5, OsuGame.Tournament ? 10 : 2); Set(OsuConfig.DistanceSpacing, 0.8, 0.1, 6); Set(OsuConfig.EditorBeatDivisor, 1, 1, 16); diff --git a/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs b/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs index 29cf7ef589..4d9598fabe 100644 --- a/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs +++ b/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs @@ -1,8 +1,11 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //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.Graphics.Sprites; +using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Options.Audio @@ -10,18 +13,26 @@ namespace osu.Game.Overlays.Options.Audio public class OffsetAdjustmentOptions : OptionsSubsection { protected override string Header => "Offset Adjustment"; - - public OffsetAdjustmentOptions() - { - Children = new Drawable[] - { - new SpriteText { Text = "Universal Offset: TODO slider" }, - new OsuButton - { - RelativeSizeAxes = Axes.X, - Text = "Offset wizard" - } - }; + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + Children = new Drawable[] + { + // TODO: bindable int crap + /* + new OptionsSlider + { + Label = "Universal Offset", + Bindable = (BindableDouble)config.GetBindable(OsuConfig.Offset) + }, + */ + new OsuButton + { + RelativeSizeAxes = Axes.X, + Text = "Offset wizard" + } + }; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs index d8fc71fb02..81143c6127 100644 --- a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs @@ -1,49 +1,61 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; -using osu.Framework.Allocation; -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"; - - [BackgroundDependencyLoader] - private void load(OsuConfigManager config) - { - Children = new Drawable[] - { - new SpriteText { Text = "Background dim: TODO slider" }, - new SpriteText { Text = "Progress display: TODO dropdown" }, - new SpriteText { Text = "Score meter type: TODO dropdown" }, - new SpriteText { Text = "Score meter size: TODO slider" }, - new CheckBoxOption - { - LabelText = "Always show key overlay", - Bindable = config.GetBindable(OsuConfig.KeyOverlay) - }, - new CheckBoxOption - { - LabelText = "Show approach circle on first \"Hidden\" object", - Bindable = config.GetBindable(OsuConfig.HiddenShowFirstApproach) - }, - new CheckBoxOption - { - LabelText = "Scale osu!mania scroll speed with BPM", - Bindable = config.GetBindable(OsuConfig.ManiaSpeedBPMScale) - }, - new CheckBoxOption - { - LabelText = "Remember osu!mania scroll speed per beatmap", - Bindable = config.GetBindable(OsuConfig.UsePerBeatmapManiaSpeed) - }, - }; - } - } -} \ No newline at end of file +using osu.Framework; +using osu.Framework.Allocation; +using osu.Framework.Configuration; +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"; + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + Children = new Drawable[] + { + // TODO: bindable int stuff + /* + new OptionsSlider + { + Label = "Background dim", + Bindable = (BindableDouble)config.GetBindable(OsuConfig.DimLevel) + }, + */ + new SpriteText { Text = "Progress display: TODO dropdown" }, + new SpriteText { Text = "Score meter type: TODO dropdown" }, + new OptionsSlider + { + Label = "Score meter size", + Bindable = (BindableDouble)config.GetBindable(OsuConfig.ScoreMeterScale) + }, + new CheckBoxOption + { + LabelText = "Always show key overlay", + Bindable = config.GetBindable(OsuConfig.KeyOverlay) + }, + new CheckBoxOption + { + LabelText = "Show approach circle on first \"Hidden\" object", + Bindable = config.GetBindable(OsuConfig.HiddenShowFirstApproach) + }, + new CheckBoxOption + { + LabelText = "Scale osu!mania scroll speed with BPM", + Bindable = config.GetBindable(OsuConfig.ManiaSpeedBPMScale) + }, + new CheckBoxOption + { + LabelText = "Remember osu!mania scroll speed per beatmap", + Bindable = config.GetBindable(OsuConfig.UsePerBeatmapManiaSpeed) + }, + }; + } + } +} diff --git a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs index 2a650ee177..c4591976e3 100644 --- a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs @@ -1,23 +1,53 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; +using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Options.Gameplay { public class SongSelectGameplayOptions : OptionsSubsection { - protected override string Header => "Song Select"; - - public SongSelectGameplayOptions() - { - Children = new Drawable[] - { - new SpriteText { Text = "Display beatmaps from: TODO slider" }, - new SpriteText { Text = "up to: TODO slider" }, - }; - } + protected override string Header => "Song Select"; + + //private BindableInt starMinimum, starMaximum; + //private StarCounter counterMin, counterMax; + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + // TODO: Deal with bindable ints + /* + starMinimum = config.GetBindable(OsuConfig.DisplayStarsMinimum); + starMaximum = config.GetBindable(OsuConfig.DisplayStarsMaximum); + Children = new Drawable[] + { + new OptionsSlider { Label = "Display beatmaps from", Bindable = starMinimum }, + counterMin = new StarCounter { Count = starMinimum.Value }, + new OptionsSlider { Label = "up to", Bindable = starMaximum }, + counterMax = new StarCounter { Count = starMaximum.Value }, + }; + starMinimum.ValueChanged += starValueChanged; + starMaximum.ValueChanged += starValueChanged;*/ + } + + private void starValueChanged(object sender, EventArgs e) + { + //counterMin.Count = starMinimum.Value; + //counterMax.Count = starMaximum.Value; + } + + protected override void Dispose(bool isDisposing) + { + //starMinimum.ValueChanged -= starValueChanged; + //starMaximum.ValueChanged -= starValueChanged; + base.Dispose(isDisposing); + } } } diff --git a/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs b/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs index 06e2be25d1..d4243a24b1 100644 --- a/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs @@ -3,6 +3,7 @@ using osu.Framework; using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; @@ -30,10 +31,19 @@ namespace osu.Game.Overlays.Options.Graphics LabelText = "Letterboxing", Bindable = config.GetBindable(OsuConfig.Letterboxing), }, - new SpriteText { Text = "Horizontal position" }, - new SpriteText { Text = "TODO: slider" }, - new SpriteText { Text = "Vertical position" }, - new SpriteText { Text = "TODO: slider" }, + // TODO: deal with bindable ints + /* + new OptionsSlider + { + Label = "Horizontal position", + Bindable = config.GetBindable(OsuConfig.LetterboxPositionX) + }, + new OptionsSlider + { + Label = "Vertical position", + Bindable = config.GetBindable(OsuConfig.LetterboxPositionY) + }, + */ }; } } diff --git a/osu.Game/Overlays/Options/OptionsSlider.cs b/osu.Game/Overlays/Options/OptionsSlider.cs index a8d0a3da6f..9f6e4e1552 100644 --- a/osu.Game/Overlays/Options/OptionsSlider.cs +++ b/osu.Game/Overlays/Options/OptionsSlider.cs @@ -17,7 +17,11 @@ namespace osu.Game.Overlays.Options public string Label { get { return text.Text; } - set { text.Text = value; } + set + { + text.Text = value; + text.Alpha = string.IsNullOrEmpty(value) ? 0 : 1; + } } public BindableDouble Bindable @@ -33,7 +37,7 @@ namespace osu.Game.Overlays.Options AutoSizeAxes = Axes.Y; Children = new Drawable[] { - text = new SpriteText(), + text = new SpriteText { Alpha = 0 }, slider = new SliderBar { Margin = new MarginPadding { Top = 5 },