1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Merge pull request #4114 from peppy/fix-replay-multiplier-text

Fix replay playback speed not being displayed initially
This commit is contained in:
Dean Herbert 2019-01-31 22:24:42 +09:00 committed by GitHub
commit 499e06797a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,10 +19,10 @@ namespace osu.Game.Screens.Play.PlayerSettings
private readonly PlayerSliderBar<double> sliderbar;
private readonly OsuSpriteText multiplierText;
public PlaybackSettings()
{
OsuSpriteText multiplierText;
Children = new Drawable[]
{
new Container
@ -57,9 +57,6 @@ namespace osu.Game.Screens.Play.PlayerSettings
},
}
};
sliderbar.Bindable.ValueChanged += rateMultiplier => multiplierText.Text = $"{sliderbar.Bar.TooltipText}x";
sliderbar.Bindable.TriggerChange();
}
protected override void LoadComplete()
@ -70,7 +67,11 @@ namespace osu.Game.Screens.Play.PlayerSettings
return;
var clockRate = AdjustableClock.Rate;
sliderbar.Bindable.ValueChanged += rateMultiplier => AdjustableClock.Rate = clockRate * rateMultiplier;
// can't trigger this line instantly as the underlying clock may not be ready to accept adjustments yet.
sliderbar.Bindable.ValueChanged += multiplier => AdjustableClock.Rate = clockRate * multiplier;
sliderbar.Bindable.BindValueChanged(multiplier => multiplierText.Text = $"{multiplier:0.0}x", true);
}
}
}