1
0
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:
EVAST9919 2017-10-03 20:05:50 +03:00
parent b94c78e993
commit feb0b1852f
2 changed files with 16 additions and 4 deletions

View File

@ -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;

View File

@ -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;
}
}
}
}