Wire up remaining sliders, except for ints

This commit is contained in:
Drew DeVault
2016-11-30 10:32:07 -05:00
parent a350e95e40
commit 3aefa4d6a5
6 changed files with 143 additions and 75 deletions

View File

@ -96,6 +96,7 @@ namespace osu.Game.Configuration
Set(OsuConfig.MouseDisableWheel, false); Set(OsuConfig.MouseDisableWheel, false);
Set(OsuConfig.MouseSpeed, 1, 0.4, 6); Set(OsuConfig.MouseSpeed, 1, 0.4, 6);
Set(OsuConfig.Offset, 0, -300, 300); 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.ScoreMeterScale, 1, 0.5, OsuGame.Tournament ? 10 : 2);
Set(OsuConfig.DistanceSpacing, 0.8, 0.1, 6); Set(OsuConfig.DistanceSpacing, 0.8, 0.1, 6);
Set(OsuConfig.EditorBeatDivisor, 1, 1, 16); Set(OsuConfig.EditorBeatDivisor, 1, 1, 16);

View File

@ -1,8 +1,11 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //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;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Audio namespace osu.Game.Overlays.Options.Audio
@ -10,18 +13,26 @@ namespace osu.Game.Overlays.Options.Audio
public class OffsetAdjustmentOptions : OptionsSubsection public class OffsetAdjustmentOptions : OptionsSubsection
{ {
protected override string Header => "Offset Adjustment"; protected override string Header => "Offset Adjustment";
public OffsetAdjustmentOptions() [BackgroundDependencyLoader]
{ private void load(OsuConfigManager config)
Children = new Drawable[] {
{ Children = new Drawable[]
new SpriteText { Text = "Universal Offset: TODO slider" }, {
new OsuButton // TODO: bindable int crap
{ /*
RelativeSizeAxes = Axes.X, new OptionsSlider
Text = "Offset wizard" {
} Label = "Universal Offset",
}; Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.Offset)
},
*/
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Offset wizard"
}
};
} }
} }
} }

View File

@ -1,49 +1,61 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Configuration;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Gameplay
{ namespace osu.Game.Overlays.Options.Gameplay
public class GeneralGameplayOptions : OptionsSubsection {
{ public class GeneralGameplayOptions : OptionsSubsection
protected override string Header => "General"; {
protected override string Header => "General";
[BackgroundDependencyLoader]
private void load(OsuConfigManager config) [BackgroundDependencyLoader]
{ private void load(OsuConfigManager config)
Children = new Drawable[] {
{ Children = new Drawable[]
new SpriteText { Text = "Background dim: TODO slider" }, {
new SpriteText { Text = "Progress display: TODO dropdown" }, // TODO: bindable int stuff
new SpriteText { Text = "Score meter type: TODO dropdown" }, /*
new SpriteText { Text = "Score meter size: TODO slider" }, new OptionsSlider
new CheckBoxOption {
{ Label = "Background dim",
LabelText = "Always show key overlay", Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.DimLevel)
Bindable = config.GetBindable<bool>(OsuConfig.KeyOverlay) },
}, */
new CheckBoxOption new SpriteText { Text = "Progress display: TODO dropdown" },
{ new SpriteText { Text = "Score meter type: TODO dropdown" },
LabelText = "Show approach circle on first \"Hidden\" object", new OptionsSlider
Bindable = config.GetBindable<bool>(OsuConfig.HiddenShowFirstApproach) {
}, Label = "Score meter size",
new CheckBoxOption Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.ScoreMeterScale)
{ },
LabelText = "Scale osu!mania scroll speed with BPM", new CheckBoxOption
Bindable = config.GetBindable<bool>(OsuConfig.ManiaSpeedBPMScale) {
}, LabelText = "Always show key overlay",
new CheckBoxOption Bindable = config.GetBindable<bool>(OsuConfig.KeyOverlay)
{ },
LabelText = "Remember osu!mania scroll speed per beatmap", new CheckBoxOption
Bindable = config.GetBindable<bool>(OsuConfig.UsePerBeatmapManiaSpeed) {
}, LabelText = "Show approach circle on first \"Hidden\" object",
}; Bindable = config.GetBindable<bool>(OsuConfig.HiddenShowFirstApproach)
} },
} new CheckBoxOption
} {
LabelText = "Scale osu!mania scroll speed with BPM",
Bindable = config.GetBindable<bool>(OsuConfig.ManiaSpeedBPMScale)
},
new CheckBoxOption
{
LabelText = "Remember osu!mania scroll speed per beatmap",
Bindable = config.GetBindable<bool>(OsuConfig.UsePerBeatmapManiaSpeed)
},
};
}
}
}

View File

@ -1,23 +1,53 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //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;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Gameplay namespace osu.Game.Overlays.Options.Gameplay
{ {
public class SongSelectGameplayOptions : OptionsSubsection public class SongSelectGameplayOptions : OptionsSubsection
{ {
protected override string Header => "Song Select"; protected override string Header => "Song Select";
public SongSelectGameplayOptions() //private BindableInt starMinimum, starMaximum;
{ //private StarCounter counterMin, counterMax;
Children = new Drawable[]
{ [BackgroundDependencyLoader]
new SpriteText { Text = "Display beatmaps from: TODO slider" }, private void load(OsuConfigManager config)
new SpriteText { Text = "up to: TODO slider" }, {
}; // TODO: Deal with bindable ints
} /*
starMinimum = config.GetBindable<int>(OsuConfig.DisplayStarsMinimum);
starMaximum = config.GetBindable<int>(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);
}
} }
} }

View File

@ -3,6 +3,7 @@
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
@ -30,10 +31,19 @@ namespace osu.Game.Overlays.Options.Graphics
LabelText = "Letterboxing", LabelText = "Letterboxing",
Bindable = config.GetBindable<bool>(OsuConfig.Letterboxing), Bindable = config.GetBindable<bool>(OsuConfig.Letterboxing),
}, },
new SpriteText { Text = "Horizontal position" }, // TODO: deal with bindable ints
new SpriteText { Text = "TODO: slider" }, /*
new SpriteText { Text = "Vertical position" }, new OptionsSlider
new SpriteText { Text = "TODO: slider" }, {
Label = "Horizontal position",
Bindable = config.GetBindable<int>(OsuConfig.LetterboxPositionX)
},
new OptionsSlider
{
Label = "Vertical position",
Bindable = config.GetBindable<int>(OsuConfig.LetterboxPositionY)
},
*/
}; };
} }
} }

View File

@ -17,7 +17,11 @@ namespace osu.Game.Overlays.Options
public string Label public string Label
{ {
get { return text.Text; } get { return text.Text; }
set { text.Text = value; } set
{
text.Text = value;
text.Alpha = string.IsNullOrEmpty(value) ? 0 : 1;
}
} }
public BindableDouble Bindable public BindableDouble Bindable
@ -33,7 +37,7 @@ namespace osu.Game.Overlays.Options
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Children = new Drawable[] Children = new Drawable[]
{ {
text = new SpriteText(), text = new SpriteText { Alpha = 0 },
slider = new SliderBar slider = new SliderBar
{ {
Margin = new MarginPadding { Top = 5 }, Margin = new MarginPadding { Top = 5 },