From 157b1f301b11ad6887b79edbe31e386d21f2c674 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Jul 2023 19:58:23 +0900 Subject: [PATCH] Rename `AllowTrackAdjustments` to more understandable `ApplyModTrackAdjustments` --- .../Visual/TestSceneOsuScreenStack.cs | 26 +++++++++---------- .../Overlays/FirstRunSetup/ScreenUIScale.cs | 2 +- osu.Game/Overlays/MusicController.cs | 14 +++++----- osu.Game/Screens/Edit/Editor.cs | 2 +- osu.Game/Screens/IOsuScreen.cs | 2 +- .../Screens/OnlinePlay/Match/RoomSubScreen.cs | 2 +- .../Spectate/MultiSpectatorScreen.cs | 2 +- osu.Game/Screens/OsuScreen.cs | 14 +++++----- osu.Game/Screens/Play/Player.cs | 2 +- osu.Game/Screens/Select/SongSelect.cs | 2 +- 10 files changed, 34 insertions(+), 34 deletions(-) diff --git a/osu.Game.Tests/Visual/TestSceneOsuScreenStack.cs b/osu.Game.Tests/Visual/TestSceneOsuScreenStack.cs index 7f01a67903..6b39717354 100644 --- a/osu.Game.Tests/Visual/TestSceneOsuScreenStack.cs +++ b/osu.Game.Tests/Visual/TestSceneOsuScreenStack.cs @@ -56,38 +56,38 @@ namespace osu.Game.Tests.Visual public void AllowTrackAdjustmentsTest() { AddStep("push allowing screen", () => stack.Push(loadNewScreen())); - AddAssert("allows adjustments 1", () => musicController.AllowTrackAdjustments); + AddAssert("allows adjustments 1", () => musicController.ApplyModTrackAdjustments); AddStep("push inheriting screen", () => stack.Push(loadNewScreen())); - AddAssert("allows adjustments 2", () => musicController.AllowTrackAdjustments); + AddAssert("allows adjustments 2", () => musicController.ApplyModTrackAdjustments); AddStep("push disallowing screen", () => stack.Push(loadNewScreen())); - AddAssert("disallows adjustments 3", () => !musicController.AllowTrackAdjustments); + AddAssert("disallows adjustments 3", () => !musicController.ApplyModTrackAdjustments); AddStep("push inheriting screen", () => stack.Push(loadNewScreen())); - AddAssert("disallows adjustments 4", () => !musicController.AllowTrackAdjustments); + AddAssert("disallows adjustments 4", () => !musicController.ApplyModTrackAdjustments); AddStep("push inheriting screen", () => stack.Push(loadNewScreen())); - AddAssert("disallows adjustments 5", () => !musicController.AllowTrackAdjustments); + AddAssert("disallows adjustments 5", () => !musicController.ApplyModTrackAdjustments); AddStep("push allowing screen", () => stack.Push(loadNewScreen())); - AddAssert("allows adjustments 6", () => musicController.AllowTrackAdjustments); + AddAssert("allows adjustments 6", () => musicController.ApplyModTrackAdjustments); // Now start exiting from screens AddStep("exit screen", () => stack.Exit()); - AddAssert("disallows adjustments 7", () => !musicController.AllowTrackAdjustments); + AddAssert("disallows adjustments 7", () => !musicController.ApplyModTrackAdjustments); AddStep("exit screen", () => stack.Exit()); - AddAssert("disallows adjustments 8", () => !musicController.AllowTrackAdjustments); + AddAssert("disallows adjustments 8", () => !musicController.ApplyModTrackAdjustments); AddStep("exit screen", () => stack.Exit()); - AddAssert("disallows adjustments 9", () => !musicController.AllowTrackAdjustments); + AddAssert("disallows adjustments 9", () => !musicController.ApplyModTrackAdjustments); AddStep("exit screen", () => stack.Exit()); - AddAssert("allows adjustments 10", () => musicController.AllowTrackAdjustments); + AddAssert("allows adjustments 10", () => musicController.ApplyModTrackAdjustments); AddStep("exit screen", () => stack.Exit()); - AddAssert("allows adjustments 11", () => musicController.AllowTrackAdjustments); + AddAssert("allows adjustments 11", () => musicController.ApplyModTrackAdjustments); } public partial class TestScreen : ScreenWithBeatmapBackground @@ -129,12 +129,12 @@ namespace osu.Game.Tests.Visual private partial class AllowScreen : OsuScreen { - public override bool? AllowTrackAdjustments => true; + public override bool? ApplyModTrackAdjustments => true; } public partial class DisallowScreen : OsuScreen { - public override bool? AllowTrackAdjustments => false; + public override bool? ApplyModTrackAdjustments => false; } private partial class InheritScreen : OsuScreen diff --git a/osu.Game/Overlays/FirstRunSetup/ScreenUIScale.cs b/osu.Game/Overlays/FirstRunSetup/ScreenUIScale.cs index e3cd2ae36c..02f0ad9506 100644 --- a/osu.Game/Overlays/FirstRunSetup/ScreenUIScale.cs +++ b/osu.Game/Overlays/FirstRunSetup/ScreenUIScale.cs @@ -104,7 +104,7 @@ namespace osu.Game.Overlays.FirstRunSetup { protected override bool ControlGlobalMusic => false; - public override bool? AllowTrackAdjustments => false; + public override bool? ApplyModTrackAdjustments => false; } private partial class UIScaleSlider : RoundedSliderBar diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 0d175a624c..562140f5cb 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -356,20 +356,20 @@ namespace osu.Game.Overlays NextTrack(); } - private bool allowTrackAdjustments; + private bool applyModTrackAdjustments; /// /// Whether mod track adjustments are allowed to be applied. /// - public bool AllowTrackAdjustments + public bool ApplyModTrackAdjustments { - get => allowTrackAdjustments; + get => applyModTrackAdjustments; set { - if (allowTrackAdjustments == value) + if (applyModTrackAdjustments == value) return; - allowTrackAdjustments = value; + applyModTrackAdjustments = value; ResetTrackAdjustments(); } } @@ -377,7 +377,7 @@ namespace osu.Game.Overlays private AudioAdjustments modTrackAdjustments; /// - /// Resets the adjustments currently applied on and applies the mod adjustments if is true. + /// Resets the adjustments currently applied on and applies the mod adjustments if is true. /// /// /// Does not reset any adjustments applied directly to the beatmap track. @@ -390,7 +390,7 @@ namespace osu.Game.Overlays CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Tempo); CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Volume); - if (allowTrackAdjustments) + if (applyModTrackAdjustments) { CurrentTrack.BindAdjustments(modTrackAdjustments = new AudioAdjustments()); diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 17e5eb8ef6..b885eee46f 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -66,7 +66,7 @@ namespace osu.Game.Screens.Edit public override bool DisallowExternalBeatmapRulesetChanges => true; - public override bool? AllowTrackAdjustments => false; + public override bool? ApplyModTrackAdjustments => false; protected override bool PlayExitSound => !ExitConfirmed && !switchingDifficulty; diff --git a/osu.Game/Screens/IOsuScreen.cs b/osu.Game/Screens/IOsuScreen.cs index cceede5424..756fbb80a7 100644 --- a/osu.Game/Screens/IOsuScreen.cs +++ b/osu.Game/Screens/IOsuScreen.cs @@ -67,7 +67,7 @@ namespace osu.Game.Screens /// Whether mod track adjustments should be applied on entering this screen. /// A value means that the parent screen's value of this setting will be used. /// - bool? AllowTrackAdjustments { get; } + bool? ApplyModTrackAdjustments { get; } /// /// Invoked when the back button has been pressed to close any overlays before exiting this . diff --git a/osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs b/osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs index 75b673cf1b..8d08de4168 100644 --- a/osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs +++ b/osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs @@ -41,7 +41,7 @@ namespace osu.Game.Screens.OnlinePlay.Match [Cached(typeof(IBindable))] public readonly Bindable SelectedItem = new Bindable(); - public override bool? AllowTrackAdjustments => true; + public override bool? ApplyModTrackAdjustments => true; protected override BackgroundScreen CreateBackground() => new RoomBackgroundScreen(Room.Playlist.FirstOrDefault()) { diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/MultiSpectatorScreen.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/MultiSpectatorScreen.cs index 2d2aa0f1d5..92ce86bef2 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/MultiSpectatorScreen.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/MultiSpectatorScreen.cs @@ -29,7 +29,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate public override bool DisallowExternalBeatmapRulesetChanges => true; // We are managing our own adjustments. For now, this happens inside the Player instances themselves. - public override bool? AllowTrackAdjustments => false; + public override bool? ApplyModTrackAdjustments => false; /// /// Whether all spectating players have finished loading. diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 9c098794a6..869d14c030 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -85,7 +85,7 @@ namespace osu.Game.Screens [Resolved] private MusicController musicController { get; set; } - public virtual bool? AllowTrackAdjustments => null; + public virtual bool? ApplyModTrackAdjustments => null; public Bindable Beatmap { get; private set; } @@ -95,7 +95,7 @@ namespace osu.Game.Screens private OsuScreenDependencies screenDependencies; - private bool? trackAdjustmentStateAtSuspend; + private bool? modTrackAdjustmentStateAtSuspend; internal void CreateLeasedDependencies(IReadOnlyDependencyContainer dependencies) => createDependencies(dependencies); @@ -178,8 +178,8 @@ namespace osu.Game.Screens // it's feasible to resume to a screen if the target screen never loaded successfully. // in such a case there's no need to restore this value. - if (trackAdjustmentStateAtSuspend != null) - musicController.AllowTrackAdjustments = trackAdjustmentStateAtSuspend.Value; + if (modTrackAdjustmentStateAtSuspend != null) + musicController.ApplyModTrackAdjustments = modTrackAdjustmentStateAtSuspend.Value; base.OnResuming(e); } @@ -188,7 +188,7 @@ namespace osu.Game.Screens { base.OnSuspending(e); - trackAdjustmentStateAtSuspend = musicController.AllowTrackAdjustments; + modTrackAdjustmentStateAtSuspend = musicController.ApplyModTrackAdjustments; onSuspendingLogo(); } @@ -197,8 +197,8 @@ namespace osu.Game.Screens { applyArrivingDefaults(false); - if (AllowTrackAdjustments != null) - musicController.AllowTrackAdjustments = AllowTrackAdjustments.Value; + if (ApplyModTrackAdjustments != null) + musicController.ApplyModTrackAdjustments = ApplyModTrackAdjustments.Value; if (backgroundStack?.Push(ownedBackground = CreateBackground()) != true) { diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 379c10a4a4..e2e8b71c10 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -69,7 +69,7 @@ namespace osu.Game.Screens.Play protected override OverlayActivation InitialOverlayActivationMode => OverlayActivation.UserTriggered; // We are managing our own adjustments (see OnEntering/OnExiting). - public override bool? AllowTrackAdjustments => false; + public override bool? ApplyModTrackAdjustments => false; private readonly IBindable gameActive = new Bindable(true); diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 47e5325baf..58755878d0 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -60,7 +60,7 @@ namespace osu.Game.Screens.Select protected virtual bool ShowFooter => true; - public override bool? AllowTrackAdjustments => true; + public override bool? ApplyModTrackAdjustments => true; /// /// Can be null if is false.