1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 18:32:56 +08:00

Update star min/max type, just use sliders for now

This commit is contained in:
Drew DeVault 2016-12-05 09:17:46 -05:00
parent 9db8e63f83
commit bf33bded24

View File

@ -13,38 +13,24 @@ namespace osu.Game.Overlays.Options.Gameplay
{
public class SongSelectGameplayOptions : OptionsSubsection
{
protected override string Header => "Song Select";
private BindableInt starMinimum, starMaximum;
private StarCounter counterMin, counterMax;
protected override string Header => "Song Select";
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
starMinimum = (BindableInt)config.GetBindable<int>(OsuConfig.DisplayStarsMinimum);
starMaximum = (BindableInt)config.GetBindable<int>(OsuConfig.DisplayStarsMaximum);
Children = new Drawable[]
{
new SliderOption<int> { LabelText = "Display beatmaps from", Bindable = starMinimum },
counterMin = new StarCounter { Count = starMinimum.Value },
new SliderOption<int> { LabelText = "up to", Bindable = starMaximum },
counterMax = new StarCounter { Count = starMaximum.Value },
new SliderOption<double>
{
LabelText = "Display beatmaps from",
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.DisplayStarsMinimum)
},
new SliderOption<double>
{
LabelText = "up to",
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.DisplayStarsMaximum)
},
};
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);
}
}
}