mirror of https://github.com/ppy/osu
Move all the "inherit previous `AllowTrackAdjustments`" logic into `OsuScreen`
This commit is contained in:
parent
931e873a7e
commit
318f0941ca
|
@ -1075,10 +1075,7 @@ protected virtual void ScreenChanged(IScreen current, IScreen newScreen)
|
|||
OverlayActivationMode.BindTo(newOsuScreen.OverlayActivationMode);
|
||||
API.Activity.BindTo(newOsuScreen.Activity);
|
||||
|
||||
if (newOsuScreen.AllowTrackAdjustments.HasValue)
|
||||
MusicController.AllowTrackAdjustments = newOsuScreen.AllowTrackAdjustments.Value;
|
||||
else
|
||||
newOsuScreen.AllowTrackAdjustments = MusicController.AllowTrackAdjustments;
|
||||
MusicController.AllowTrackAdjustments = newOsuScreen.AllowTrackAdjustments;
|
||||
|
||||
if (newOsuScreen.HideOverlaysOnEnter)
|
||||
CloseAllOverlays();
|
||||
|
|
|
@ -56,7 +56,7 @@ public class Editor : ScreenWithBeatmapBackground, IKeyBindingHandler<GlobalActi
|
|||
|
||||
public override bool DisallowExternalBeatmapRulesetChanges => true;
|
||||
|
||||
public override bool? AllowTrackAdjustments => false;
|
||||
public override bool AllowTrackAdjustments => false;
|
||||
|
||||
protected bool HasUnsavedChanges => lastSavedHash != changeHandler.CurrentStateHash;
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ public interface IOsuScreen : IScreen
|
|||
/// Whether mod track adjustments are allowed to be applied.
|
||||
/// A <see langword="null"/> value means that the parent screen's value of this setting will be used.
|
||||
/// </summary>
|
||||
bool? AllowTrackAdjustments { get; set; }
|
||||
bool AllowTrackAdjustments { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when the back button has been pressed to close any overlays before exiting this <see cref="IOsuScreen"/>.
|
||||
|
|
|
@ -26,7 +26,7 @@ public class MultiSpectatorScreen : SpectatorScreen
|
|||
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 AllowTrackAdjustments => false;
|
||||
|
||||
/// <summary>
|
||||
/// Whether all spectating players have finished loading.
|
||||
|
|
|
@ -11,7 +11,7 @@ public abstract class OnlinePlaySubScreen : OsuScreen, IOnlinePlaySubScreen
|
|||
{
|
||||
public override bool DisallowExternalBeatmapRulesetChanges => false;
|
||||
|
||||
public override bool? AllowTrackAdjustments => true;
|
||||
public override bool AllowTrackAdjustments => true;
|
||||
|
||||
public virtual string ShortTitle => Title;
|
||||
|
||||
|
|
|
@ -81,7 +81,12 @@ public abstract class OsuScreen : Screen, IOsuScreen, IHasDescription
|
|||
|
||||
public virtual float BackgroundParallaxAmount => 1;
|
||||
|
||||
public virtual bool? AllowTrackAdjustments { get; set; }
|
||||
[Resolved]
|
||||
private MusicController musicController { get; set; }
|
||||
|
||||
private bool? allowTrackAdjustments;
|
||||
|
||||
public virtual bool AllowTrackAdjustments => allowTrackAdjustments ??= (musicController?.AllowTrackAdjustments ?? false);
|
||||
|
||||
public Bindable<WorkingBeatmap> Beatmap { get; private set; }
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ public abstract class Player : ScreenWithBeatmapBackground, ISamplePlaybackDisab
|
|||
protected override OverlayActivation InitialOverlayActivationMode => OverlayActivation.UserTriggered;
|
||||
|
||||
// We are managing our own adjustments (see OnEntering/OnExiting).
|
||||
public override bool? AllowTrackAdjustments => false;
|
||||
public override bool AllowTrackAdjustments => false;
|
||||
|
||||
private readonly IBindable<bool> gameActive = new Bindable<bool>(true);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public abstract class SongSelect : ScreenWithBeatmapBackground, IKeyBindingHandl
|
|||
|
||||
protected virtual bool DisplayStableImportPrompt => stableImportManager?.SupportsImportFromStable == true;
|
||||
|
||||
public override bool? AllowTrackAdjustments => true;
|
||||
public override bool AllowTrackAdjustments => true;
|
||||
|
||||
/// <summary>
|
||||
/// Can be null if <see cref="ShowFooter"/> is false.
|
||||
|
|
Loading…
Reference in New Issue