mirror of
https://github.com/ppy/osu
synced 2025-01-20 04:50:50 +00:00
Add back explicit binds.
This commit is contained in:
parent
ba03a98992
commit
5af4259ab4
@ -99,6 +99,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
AddToggleStep(@"auto", state => { auto = state; load(mode); });
|
||||
|
||||
BasicSliderBar<double> sliderBar;
|
||||
Add(new Container
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
@ -107,16 +108,17 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new SpriteText { Text = "Playback Speed" },
|
||||
new BasicSliderBar<double>
|
||||
sliderBar = new BasicSliderBar<double>
|
||||
{
|
||||
Width = 150,
|
||||
Height = 10,
|
||||
SelectionColor = Color4.Orange,
|
||||
Current = playbackSpeed
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
sliderBar.Current.BindTo(playbackSpeed);
|
||||
|
||||
framedClock.ProcessFrame();
|
||||
|
||||
var clockAdjustContainer = new Container
|
||||
|
@ -44,6 +44,8 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
kc.Add(new KeyCounterKeyboard(key));
|
||||
});
|
||||
|
||||
TestSliderBar<int> sliderBar;
|
||||
|
||||
Add(new Container
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
@ -52,16 +54,17 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new SpriteText { Text = "FadeTime" },
|
||||
new TestSliderBar<int>
|
||||
sliderBar =new TestSliderBar<int>
|
||||
{
|
||||
Width = 150,
|
||||
Height = 10,
|
||||
SelectionColor = Color4.Orange,
|
||||
Current = bindable
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
sliderBar.Current.BindTo(bindable);
|
||||
|
||||
Add(kc);
|
||||
}
|
||||
private class TestSliderBar<T> : SliderBar<T> where T : struct
|
||||
|
@ -92,12 +92,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
}
|
||||
}
|
||||
|
||||
private readonly Bindable<bool> current = new Bindable<bool>();
|
||||
|
||||
public Bindable<bool> Current
|
||||
{
|
||||
get { return current; }
|
||||
set { current.BindTo(value); }
|
||||
}
|
||||
public Bindable<bool> Current { get; } = new Bindable<bool>();
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
set
|
||||
{
|
||||
bindable = value;
|
||||
Current = bindable;
|
||||
Current.BindTo(bindable);
|
||||
if (value?.Disabled ?? true)
|
||||
Alpha = 0.3f;
|
||||
}
|
||||
@ -69,13 +69,14 @@ namespace osu.Game.Graphics.UserInterface
|
||||
labelSpriteText = new OsuSpriteText(),
|
||||
nub = new Nub
|
||||
{
|
||||
Current = Current,
|
||||
Anchor = Anchor.CentreRight,
|
||||
Origin = Anchor.CentreRight,
|
||||
Margin = new MarginPadding { Right = 5 },
|
||||
}
|
||||
};
|
||||
|
||||
nub.Current.BindTo(Current);
|
||||
|
||||
Current.ValueChanged += newValue =>
|
||||
{
|
||||
if (newValue)
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Overlays.Options
|
||||
set
|
||||
{
|
||||
bindable = value;
|
||||
dropdown.Current = bindable;
|
||||
dropdown.Current.BindTo(bindable);
|
||||
if (value?.Disabled ?? true)
|
||||
Alpha = 0.3f;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ namespace osu.Game.Overlays.Options
|
||||
set
|
||||
{
|
||||
bindable = value;
|
||||
slider.Current = bindable;
|
||||
slider.Current.BindTo(bindable);
|
||||
if (value?.Disabled ?? true)
|
||||
Alpha = 0.3f;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Options
|
||||
set
|
||||
{
|
||||
bindable = value;
|
||||
Current = bindable;
|
||||
Current.BindTo(bindable);
|
||||
if (value?.Disabled ?? true)
|
||||
Alpha = 0.3f;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user