1
0
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:
Jacob Odgård Tørring 2018-05-12 11:55:52 +02:00
parent e89ff7e519
commit a7e7c3a74a
4 changed files with 5 additions and 11 deletions

View File

@ -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;

View File

@ -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()

View File

@ -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;

View File

@ -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;