mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 09:43:10 +08:00
Move all the "inherit previous AllowTrackAdjustments
" logic into OsuScreen
This commit is contained in:
parent
931e873a7e
commit
318f0941ca
@ -1075,10 +1075,7 @@ namespace osu.Game
|
||||
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 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
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 @@ namespace osu.Game.Screens
|
||||
/// 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 @@ 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 AllowTrackAdjustments => false;
|
||||
|
||||
/// <summary>
|
||||
/// Whether all spectating players have finished loading.
|
||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Screens.OnlinePlay
|
||||
{
|
||||
public override bool DisallowExternalBeatmapRulesetChanges => false;
|
||||
|
||||
public override bool? AllowTrackAdjustments => true;
|
||||
public override bool AllowTrackAdjustments => true;
|
||||
|
||||
public virtual string ShortTitle => Title;
|
||||
|
||||
|
@ -81,7 +81,12 @@ namespace osu.Game.Screens
|
||||
|
||||
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 @@ 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 AllowTrackAdjustments => false;
|
||||
|
||||
private readonly IBindable<bool> gameActive = new Bindable<bool>(true);
|
||||
|
||||
|
@ -53,7 +53,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
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
Block a user