diff --git a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs index 226ce8b0d8..26fb127e83 100644 --- a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs +++ b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs @@ -3,6 +3,7 @@ using System; using System.Linq; +using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Track; using osu.Framework.Bindables; @@ -10,6 +11,7 @@ using osu.Framework.Graphics; using osu.Framework.Timing; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Overlays; namespace osu.Game.Screens.Play { @@ -55,6 +57,9 @@ namespace osu.Game.Screens.Play /// private double? actualStopTime; + [Resolved] + private MusicController musicController { get; set; } = null!; + /// /// Create a new master gameplay clock container. /// @@ -193,6 +198,8 @@ namespace osu.Game.Screens.Play if (speedAdjustmentsApplied) return; + musicController.ResetTrackAdjustments(); + track.BindAdjustments(GameplayAdjustments); track.AddAdjustment(AdjustableProperty.Frequency, GameplayClock.ExternalPauseFrequencyAdjust); track.AddAdjustment(AdjustableProperty.Tempo, UserPlaybackRate); diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 17cae05862..e93502da13 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -996,16 +996,8 @@ namespace osu.Game.Screens.Play foreach (var mod in GameplayState.Mods.OfType()) mod.ApplyToHUD(HUDOverlay); - // 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... - if (GameplayClockContainer is MasterGameplayClockContainer masterClock) - { - musicController.ResetTrackAdjustments(); - - foreach (var mod in GameplayState.Mods.OfType()) - mod.ApplyToTrack(masterClock.GameplayAdjustments); - } + foreach (var mod in GameplayState.Mods.OfType()) + mod.ApplyToTrack(GameplayClockContainer.GameplayAdjustments); updateGameplayState();