mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 00:42:55 +08:00
Enables/Disables seek and Play/Resume on call to beatmapDisabledChanged
This commit is contained in:
parent
e89ff7e519
commit
a7e7c3a74a
@ -538,13 +538,10 @@ namespace osu.Game
|
||||
// we only want to apply these restrictions when we are inside a screen stack.
|
||||
// the use case for not applying is in visual/unit tests.
|
||||
bool applyBeatmapRulesetRestrictions = !currentScreen?.AllowBeatmapRulesetChange ?? false;
|
||||
bool applyUserSeekRestrictions = !currentScreen?.AllowUserSeek ?? false;
|
||||
|
||||
Ruleset.Disabled = applyBeatmapRulesetRestrictions;
|
||||
Beatmap.Disabled = applyBeatmapRulesetRestrictions;
|
||||
|
||||
musicController.DisableSeek = applyUserSeekRestrictions;
|
||||
|
||||
mainContent.Padding = new MarginPadding { Top = ToolbarOffset };
|
||||
|
||||
CursorOverrideContainer.CanShowCursor = currentScreen?.CursorVisible ?? false;
|
||||
|
@ -221,9 +221,8 @@ namespace osu.Game.Overlays
|
||||
|
||||
private void conditionalSeek(double progress)
|
||||
{
|
||||
if (DisableSeek)
|
||||
return;
|
||||
current?.Track.Seek(progress);
|
||||
if (EnableSeek)
|
||||
current?.Track.Seek(progress);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -235,16 +234,18 @@ namespace osu.Game.Overlays
|
||||
base.LoadComplete();
|
||||
}
|
||||
|
||||
public bool DisableSeek { get; set; }
|
||||
private bool EnableSeek { get; set; }
|
||||
|
||||
private void beatmapDisabledChanged(bool disabled)
|
||||
{
|
||||
if (disabled)
|
||||
playlist.Hide();
|
||||
|
||||
playButton.Enabled.Value = !disabled;
|
||||
prevButton.Enabled.Value = !disabled;
|
||||
nextButton.Enabled.Value = !disabled;
|
||||
playlistButton.Enabled.Value = !disabled;
|
||||
EnableSeek = !disabled;
|
||||
}
|
||||
|
||||
protected override void UpdateAfterChildren()
|
||||
|
@ -50,8 +50,6 @@ namespace osu.Game.Screens
|
||||
/// </summary>
|
||||
public virtual bool AllowBeatmapRulesetChange => true;
|
||||
|
||||
public virtual bool AllowUserSeek => true;
|
||||
|
||||
protected readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
protected virtual float BackgroundParallaxAmount => 1;
|
||||
|
@ -45,8 +45,6 @@ namespace osu.Game.Screens.Play
|
||||
public bool AllowLeadIn { get; set; } = true;
|
||||
public bool AllowResults { get; set; } = true;
|
||||
|
||||
public override bool AllowUserSeek => false;
|
||||
|
||||
private Bindable<bool> mouseWheelDisabled;
|
||||
private Bindable<double> userAudioOffset;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user