mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 07:23:14 +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;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -10,6 +11,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Timing;
|
using osu.Framework.Timing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
{
|
{
|
||||||
@ -55,6 +57,9 @@ namespace osu.Game.Screens.Play
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private double? actualStopTime;
|
private double? actualStopTime;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private MusicController musicController { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new master gameplay clock container.
|
/// Create a new master gameplay clock container.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -193,6 +198,8 @@ namespace osu.Game.Screens.Play
|
|||||||
if (speedAdjustmentsApplied)
|
if (speedAdjustmentsApplied)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
musicController.ResetTrackAdjustments();
|
||||||
|
|
||||||
track.BindAdjustments(GameplayAdjustments);
|
track.BindAdjustments(GameplayAdjustments);
|
||||||
track.AddAdjustment(AdjustableProperty.Frequency, GameplayClock.ExternalPauseFrequencyAdjust);
|
track.AddAdjustment(AdjustableProperty.Frequency, GameplayClock.ExternalPauseFrequencyAdjust);
|
||||||
track.AddAdjustment(AdjustableProperty.Tempo, UserPlaybackRate);
|
track.AddAdjustment(AdjustableProperty.Tempo, UserPlaybackRate);
|
||||||
|
@ -996,16 +996,8 @@ namespace osu.Game.Screens.Play
|
|||||||
foreach (var mod in GameplayState.Mods.OfType<IApplicableToHUD>())
|
foreach (var mod in GameplayState.Mods.OfType<IApplicableToHUD>())
|
||||||
mod.ApplyToHUD(HUDOverlay);
|
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>())
|
foreach (var mod in GameplayState.Mods.OfType<IApplicableToTrack>())
|
||||||
mod.ApplyToTrack(masterClock.GameplayAdjustments);
|
mod.ApplyToTrack(GameplayClockContainer.GameplayAdjustments);
|
||||||
}
|
|
||||||
|
|
||||||
updateGameplayState();
|
updateGameplayState();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user