mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 21:07:33 +08:00
Add method flow to reset applied adjustments
This commit is contained in:
parent
e33486a766
commit
7084aeee05
@ -196,7 +196,9 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
void IAdjustableClock.Reset() => Reset();
|
||||
|
||||
public void ResetSpeedAdjustments() => throw new NotImplementedException();
|
||||
public virtual void ResetSpeedAdjustments()
|
||||
{
|
||||
}
|
||||
|
||||
double IAdjustableClock.Rate
|
||||
{
|
||||
|
@ -238,11 +238,14 @@ namespace osu.Game.Screens.Play
|
||||
void IAdjustableAudioComponent.RemoveAdjustment(AdjustableProperty type, IBindable<double> adjustBindable) =>
|
||||
track.RemoveAdjustment(type, adjustBindable);
|
||||
|
||||
public void RemoveAllAdjustments(AdjustableProperty type)
|
||||
public override void ResetSpeedAdjustments()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
track.RemoveAllAdjustments(AdjustableProperty.Frequency);
|
||||
track.RemoveAllAdjustments(AdjustableProperty.Tempo);
|
||||
}
|
||||
|
||||
public void RemoveAllAdjustments(AdjustableProperty type) => throw new NotImplementedException();
|
||||
|
||||
public void BindAdjustments(IAggregateAudioAdjustment component) => throw new NotImplementedException();
|
||||
public void UnbindAdjustments(IAggregateAudioAdjustment component) => throw new NotImplementedException();
|
||||
|
||||
|
@ -999,9 +999,12 @@ namespace osu.Game.Screens.Play
|
||||
// Our mods are local copies of the global mods so they need to be re-applied to the track.
|
||||
// This is done through the music controller (for now), because resetting speed adjustments on the beatmap track also removes adjustments provided by DrawableTrack.
|
||||
// Todo: In the future, player will receive in a track and will probably not have to worry about this...
|
||||
musicController.ResetTrackAdjustments();
|
||||
foreach (var mod in GameplayState.Mods.OfType<IApplicableToTrack>())
|
||||
mod.ApplyToTrack(musicController.CurrentTrack);
|
||||
if (GameplayClockContainer is IAdjustableAudioComponent adjustableClock)
|
||||
{
|
||||
GameplayClockContainer.ResetSpeedAdjustments();
|
||||
foreach (var mod in GameplayState.Mods.OfType<IApplicableToTrack>())
|
||||
mod.ApplyToTrack(adjustableClock);
|
||||
}
|
||||
|
||||
updateGameplayState();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user