mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 16:42:57 +08:00
Unify disable logic.
This commit is contained in:
parent
b7cfdff8d1
commit
f12b5a8954
@ -24,11 +24,8 @@ namespace osu.Game.Graphics.UserInterface
|
||||
set
|
||||
{
|
||||
bindable = value;
|
||||
|
||||
if (bindable != null)
|
||||
Current = bindable;
|
||||
|
||||
if (bindable?.Disabled ?? true)
|
||||
Current = bindable;
|
||||
if (value?.Disabled ?? true)
|
||||
Alpha = 0.3f;
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ namespace osu.Game.Overlays.Options
|
||||
{
|
||||
bindable = value;
|
||||
dropdown.Current = bindable;
|
||||
if (bindable.Disabled)
|
||||
if (value?.Disabled ?? true)
|
||||
Alpha = 0.3f;
|
||||
}
|
||||
}
|
||||
|
@ -27,12 +27,14 @@ namespace osu.Game.Overlays.Options
|
||||
}
|
||||
}
|
||||
|
||||
private Bindable<T> bindable;
|
||||
|
||||
public Bindable<T> Bindable
|
||||
{
|
||||
get { return slider.Current; }
|
||||
set
|
||||
{
|
||||
slider.Current = value;
|
||||
bindable = value;
|
||||
slider.Current = bindable;
|
||||
if (value?.Disabled ?? true)
|
||||
Alpha = 0.3f;
|
||||
}
|
||||
|
@ -15,10 +15,8 @@ namespace osu.Game.Overlays.Options
|
||||
set
|
||||
{
|
||||
bindable = value;
|
||||
|
||||
Current = bindable;
|
||||
|
||||
if (bindable?.Disabled ?? true)
|
||||
if (value?.Disabled ?? true)
|
||||
Alpha = 0.3f;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user