mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 16:32:54 +08:00
Move full track adjustment flow inside MasterGameplayClockContainer
This commit is contained in:
parent
75d0deef72
commit
fa15502384
@ -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
|
||||
/// </summary>
|
||||
private double? actualStopTime;
|
||||
|
||||
[Resolved]
|
||||
private MusicController musicController { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Create a new master gameplay clock container.
|
||||
/// </summary>
|
||||
@ -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);
|
||||
|
@ -996,16 +996,8 @@ namespace osu.Game.Screens.Play
|
||||
foreach (var mod in GameplayState.Mods.OfType<IApplicableToHUD>())
|
||||
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<IApplicableToTrack>())
|
||||
mod.ApplyToTrack(masterClock.GameplayAdjustments);
|
||||
}
|
||||
foreach (var mod in GameplayState.Mods.OfType<IApplicableToTrack>())
|
||||
mod.ApplyToTrack(GameplayClockContainer.GameplayAdjustments);
|
||||
|
||||
updateGameplayState();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user