mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 09:42:54 +08:00
Remove the dangerous function
This commit is contained in:
parent
b94c78e993
commit
feb0b1852f
@ -222,7 +222,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
hudOverlay.ModDisplay.Current.BindTo(working.Mods);
|
||||
|
||||
hudOverlay.ReplaySettingsOverlay.PlaybackSettings.BindClock(adjustableSourceClock);
|
||||
hudOverlay.ReplaySettingsOverlay.PlaybackSettings.AdjustableClock = adjustableSourceClock;
|
||||
|
||||
// Bind ScoreProcessor to ourselves
|
||||
scoreProcessor.AllJudged += onCompletion;
|
||||
|
@ -10,6 +10,13 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
||||
{
|
||||
protected override string Title => @"playback";
|
||||
|
||||
private IAdjustableClock adjustableClock;
|
||||
public IAdjustableClock AdjustableClock
|
||||
{
|
||||
set { adjustableClock = value; }
|
||||
get { return adjustableClock; }
|
||||
}
|
||||
|
||||
private readonly ReplaySliderBar<double> sliderbar;
|
||||
|
||||
public PlaybackSettings()
|
||||
@ -25,10 +32,15 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
||||
};
|
||||
}
|
||||
|
||||
public void BindClock(IAdjustableClock clock)
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
var clockRate = clock.Rate;
|
||||
sliderbar.Bindable.ValueChanged += rateMultiplier => clock.Rate = clockRate * rateMultiplier;
|
||||
base.LoadComplete();
|
||||
|
||||
if (adjustableClock != null)
|
||||
{
|
||||
var clockRate = adjustableClock.Rate;
|
||||
sliderbar.Bindable.ValueChanged += rateMultiplier => adjustableClock.Rate = clockRate * rateMultiplier;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user