mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 17:37:23 +09: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.
|
// 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.
|
// the use case for not applying is in visual/unit tests.
|
||||||
bool applyBeatmapRulesetRestrictions = !currentScreen?.AllowBeatmapRulesetChange ?? false;
|
bool applyBeatmapRulesetRestrictions = !currentScreen?.AllowBeatmapRulesetChange ?? false;
|
||||||
bool applyUserSeekRestrictions = !currentScreen?.AllowUserSeek ?? false;
|
|
||||||
|
|
||||||
Ruleset.Disabled = applyBeatmapRulesetRestrictions;
|
Ruleset.Disabled = applyBeatmapRulesetRestrictions;
|
||||||
Beatmap.Disabled = applyBeatmapRulesetRestrictions;
|
Beatmap.Disabled = applyBeatmapRulesetRestrictions;
|
||||||
|
|
||||||
musicController.DisableSeek = applyUserSeekRestrictions;
|
|
||||||
|
|
||||||
mainContent.Padding = new MarginPadding { Top = ToolbarOffset };
|
mainContent.Padding = new MarginPadding { Top = ToolbarOffset };
|
||||||
|
|
||||||
CursorOverrideContainer.CanShowCursor = currentScreen?.CursorVisible ?? false;
|
CursorOverrideContainer.CanShowCursor = currentScreen?.CursorVisible ?? false;
|
||||||
|
@ -221,9 +221,8 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private void conditionalSeek(double progress)
|
private void conditionalSeek(double progress)
|
||||||
{
|
{
|
||||||
if (DisableSeek)
|
if (EnableSeek)
|
||||||
return;
|
current?.Track.Seek(progress);
|
||||||
current?.Track.Seek(progress);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -235,16 +234,18 @@ namespace osu.Game.Overlays
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DisableSeek { get; set; }
|
private bool EnableSeek { get; set; }
|
||||||
|
|
||||||
private void beatmapDisabledChanged(bool disabled)
|
private void beatmapDisabledChanged(bool disabled)
|
||||||
{
|
{
|
||||||
if (disabled)
|
if (disabled)
|
||||||
playlist.Hide();
|
playlist.Hide();
|
||||||
|
|
||||||
|
playButton.Enabled.Value = !disabled;
|
||||||
prevButton.Enabled.Value = !disabled;
|
prevButton.Enabled.Value = !disabled;
|
||||||
nextButton.Enabled.Value = !disabled;
|
nextButton.Enabled.Value = !disabled;
|
||||||
playlistButton.Enabled.Value = !disabled;
|
playlistButton.Enabled.Value = !disabled;
|
||||||
|
EnableSeek = !disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateAfterChildren()
|
protected override void UpdateAfterChildren()
|
||||||
|
@ -50,8 +50,6 @@ namespace osu.Game.Screens
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual bool AllowBeatmapRulesetChange => true;
|
public virtual bool AllowBeatmapRulesetChange => true;
|
||||||
|
|
||||||
public virtual bool AllowUserSeek => true;
|
|
||||||
|
|
||||||
protected readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
protected readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
||||||
|
|
||||||
protected virtual float BackgroundParallaxAmount => 1;
|
protected virtual float BackgroundParallaxAmount => 1;
|
||||||
|
@ -45,8 +45,6 @@ namespace osu.Game.Screens.Play
|
|||||||
public bool AllowLeadIn { get; set; } = true;
|
public bool AllowLeadIn { get; set; } = true;
|
||||||
public bool AllowResults { get; set; } = true;
|
public bool AllowResults { get; set; } = true;
|
||||||
|
|
||||||
public override bool AllowUserSeek => false;
|
|
||||||
|
|
||||||
private Bindable<bool> mouseWheelDisabled;
|
private Bindable<bool> mouseWheelDisabled;
|
||||||
private Bindable<double> userAudioOffset;
|
private Bindable<double> userAudioOffset;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user