mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 16:12:54 +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:
commit
499e06797a
@ -19,10 +19,10 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
|
|
||||||
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 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
sliderbar.Bindable.ValueChanged += rateMultiplier => multiplierText.Text = $"{sliderbar.Bar.TooltipText}x";
|
|
||||||
sliderbar.Bindable.TriggerChange();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -70,7 +67,11 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var clockRate = AdjustableClock.Rate;
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user