Visually disable options which aren't yet wired up.

This commit is contained in:
Dean Herbert
2017-02-14 00:35:24 +09:00
parent bc95666736
commit 4f9d1a6c39
8 changed files with 178 additions and 162 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -16,7 +17,7 @@ namespace osu.Game.Overlays.Options
{
private SliderBar<T> slider;
private SpriteText text;
public string LabelText
{
get { return text.Text; }
@ -26,11 +27,16 @@ namespace osu.Game.Overlays.Options
text.Alpha = string.IsNullOrEmpty(value) ? 0 : 1;
}
}
public BindableNumber<T> Bindable
{
get { return slider.Bindable; }
set { slider.Bindable = value; }
set
{
slider.Bindable = value;
if (value?.Disabled ?? true)
Alpha = 0.3f;
}
}
public OptionSlider()