1
0
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:
Dean Herbert 2022-09-05 23:22:38 +09:00
parent e33486a766
commit 7084aeee05
3 changed files with 14 additions and 6 deletions

View File

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

View File

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

View File

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