Fix replay playback speed not being displayed initially

This commit is contained in:
Dean Herbert 2019-01-22 11:40:57 +09:00
parent ca470ffaf0
commit cebeb0a219
1 changed files with 8 additions and 6 deletions

View File

@ -19,10 +19,10 @@ public class PlaybackSettings : PlayerSettingsGroup
private readonly PlayerSliderBar<double> sliderbar; private readonly PlayerSliderBar<double> sliderbar;
private readonly OsuSpriteText multiplierText;
public PlaybackSettings() public PlaybackSettings()
{ {
OsuSpriteText multiplierText;
Children = new Drawable[] Children = new Drawable[]
{ {
new Container new Container
@ -57,9 +57,6 @@ public PlaybackSettings()
}, },
} }
}; };
sliderbar.Bindable.ValueChanged += rateMultiplier => multiplierText.Text = $"{sliderbar.Bar.TooltipText}x";
sliderbar.Bindable.TriggerChange();
} }
protected override void LoadComplete() protected override void LoadComplete()
@ -70,7 +67,12 @@ protected override void LoadComplete()
return; return;
var clockRate = AdjustableClock.Rate; var clockRate = AdjustableClock.Rate;
sliderbar.Bindable.ValueChanged += rateMultiplier => AdjustableClock.Rate = clockRate * rateMultiplier;
sliderbar.Bindable.BindValueChanged(multiplier =>
{
multiplierText.Text = $"{multiplier:0.0}x";
AdjustableClock.Rate = clockRate * multiplier;
}, true);
} }
} }
} }