1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 07:43:00 +08:00

Rename GameplayAdjustments -> AdjustmentsFromMods

This commit is contained in:
Dan Balasescu 2022-09-08 17:14:06 +09:00
parent b0b4da533a
commit b559d4ecdf
10 changed files with 25 additions and 18 deletions

View File

@ -27,7 +27,7 @@ namespace osu.Game.Tests.NonVisual
public TestGameplayClockContainer(IFrameBasedClock underlyingClock)
: base(underlyingClock)
{
GameplayAdjustments.AddAdjustment(AdjustableProperty.Frequency, new BindableDouble(2.0));
AdjustmentsFromMods.AddAdjustment(AdjustableProperty.Frequency, new BindableDouble(2.0));
}
}
}

View File

@ -265,7 +265,7 @@ namespace osu.Game.Rulesets.UI
private readonly AudioAdjustments gameplayAdjustments = new AudioAdjustments();
public IAdjustableAudioComponent GameplayAdjustments => parentGameplayClock?.GameplayAdjustments ?? gameplayAdjustments;
public IAdjustableAudioComponent AdjustmentsFromMods => parentGameplayClock?.AdjustmentsFromMods ?? gameplayAdjustments;
#endregion

View File

@ -14,7 +14,10 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
/// </summary>
public class MultiSpectatorPlayer : SpectatorPlayer
{
public IAdjustableAudioComponent GameplayAdjustments => GameplayClockContainer.GameplayAdjustments;
/// <summary>
/// All adjustments applied to the clock of this <see cref="MultiSpectatorPlayer"/> which come from mods.
/// </summary>
public readonly AudioAdjustments ClockAdjustmentsFromMods = new AudioAdjustments();
private readonly SpectatorPlayerClock spectatorPlayerClock;
@ -56,6 +59,10 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
}
protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart)
=> new GameplayClockContainer(spectatorPlayerClock);
{
var gameplayClockContainer = new GameplayClockContainer(spectatorPlayerClock);
ClockAdjustmentsFromMods.BindAdjustments(gameplayClockContainer.AdjustmentsFromMods);
return gameplayClockContainer;
}
}
}

View File

@ -187,10 +187,10 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
private void bindAudioAdjustments(PlayerArea first)
{
if (boundAdjustments != null)
masterClockContainer.GameplayAdjustments.UnbindAdjustments(boundAdjustments);
masterClockContainer.AdjustmentsFromMods.UnbindAdjustments(boundAdjustments);
boundAdjustments = first.GameplayAdjustments;
masterClockContainer.GameplayAdjustments.BindAdjustments(boundAdjustments);
boundAdjustments = first.ClockAdjustmentsFromMods;
masterClockContainer.AdjustmentsFromMods.BindAdjustments(boundAdjustments);
}
private bool isCandidateAudioSource(SpectatorPlayerClock? clock)

View File

@ -43,9 +43,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
public readonly SpectatorPlayerClock SpectatorPlayerClock;
/// <summary>
/// The gameplay adjustments applied by the <see cref="Player"/> loaded in this area.
/// The clock adjustments applied by the <see cref="Player"/> loaded in this area.
/// </summary>
public readonly AudioAdjustments GameplayAdjustments = new AudioAdjustments();
public readonly AudioAdjustments ClockAdjustmentsFromMods = new AudioAdjustments();
/// <summary>
/// The currently-loaded score.
@ -103,7 +103,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
var player = new MultiSpectatorPlayer(Score, SpectatorPlayerClock);
player.OnGameplayStarted += () => OnGameplayStarted?.Invoke();
GameplayAdjustments.BindAdjustments(player.GameplayAdjustments);
ClockAdjustmentsFromMods.BindAdjustments(player.ClockAdjustmentsFromMods);
return player;
}));

View File

@ -44,7 +44,7 @@ namespace osu.Game.Screens.Play
/// </remarks>
public double StartTime { get; protected set; }
public IAdjustableAudioComponent GameplayAdjustments { get; } = new AudioAdjustments();
public IAdjustableAudioComponent AdjustmentsFromMods { get; } = new AudioAdjustments();
private readonly BindableBool isPaused = new BindableBool(true);

View File

@ -17,8 +17,8 @@ namespace osu.Game.Screens.Play
double rate = clock.Rate == 0 ? 1 : Math.Sign(clock.Rate);
return rate
* clock.GameplayAdjustments.AggregateFrequency.Value
* clock.GameplayAdjustments.AggregateTempo.Value;
* clock.AdjustmentsFromMods.AggregateFrequency.Value
* clock.AdjustmentsFromMods.AggregateTempo.Value;
}
}
}

View File

@ -19,9 +19,9 @@ namespace osu.Game.Screens.Play
double StartTime { get; }
/// <summary>
/// All adjustments applied to this clock which come from gameplay or mods.
/// All adjustments applied to this clock which come from mods.
/// </summary>
IAdjustableAudioComponent GameplayAdjustments { get; }
IAdjustableAudioComponent AdjustmentsFromMods { get; }
IBindable<bool> IsPaused { get; }
}

View File

@ -201,7 +201,7 @@ namespace osu.Game.Screens.Play
musicController.ResetTrackAdjustments();
track.BindAdjustments(GameplayAdjustments);
track.BindAdjustments(AdjustmentsFromMods);
track.AddAdjustment(AdjustableProperty.Frequency, GameplayClock.ExternalPauseFrequencyAdjust);
track.AddAdjustment(AdjustableProperty.Tempo, UserPlaybackRate);
@ -213,7 +213,7 @@ namespace osu.Game.Screens.Play
if (!speedAdjustmentsApplied)
return;
track.UnbindAdjustments(GameplayAdjustments);
track.UnbindAdjustments(AdjustmentsFromMods);
track.RemoveAdjustment(AdjustableProperty.Frequency, GameplayClock.ExternalPauseFrequencyAdjust);
track.RemoveAdjustment(AdjustableProperty.Tempo, UserPlaybackRate);

View File

@ -997,7 +997,7 @@ namespace osu.Game.Screens.Play
mod.ApplyToHUD(HUDOverlay);
foreach (var mod in GameplayState.Mods.OfType<IApplicableToTrack>())
mod.ApplyToTrack(GameplayClockContainer.GameplayAdjustments);
mod.ApplyToTrack(GameplayClockContainer.AdjustmentsFromMods);
updateGameplayState();