mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 06:13:03 +08:00
Merge pull request #1009 from peppy/fix-track-rotation
Fix track rotation
This commit is contained in:
commit
aa15d369c3
@ -69,7 +69,7 @@ namespace osu.Game.Database
|
||||
var trackData = getReader()?.GetStream(Metadata.AudioFile);
|
||||
return trackData == null ? null : new TrackBass(trackData);
|
||||
}
|
||||
catch { return null; }
|
||||
catch { return new TrackVirtual(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -59,6 +59,9 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
Width = 400;
|
||||
Margin = new MarginPadding(10);
|
||||
|
||||
// required to let MusicController handle beatmap cycling.
|
||||
AlwaysPresent = true;
|
||||
}
|
||||
|
||||
protected override bool OnDragStart(InputState state) => true;
|
||||
@ -252,12 +255,16 @@ namespace osu.Game.Overlays
|
||||
|
||||
private void prev()
|
||||
{
|
||||
if (beatmapBacking.Disabled) return;
|
||||
|
||||
queuedDirection = TransformDirection.Prev;
|
||||
playlist.PlayPrevious();
|
||||
}
|
||||
|
||||
private void next()
|
||||
{
|
||||
if (beatmapBacking.Disabled) return;
|
||||
|
||||
queuedDirection = TransformDirection.Next;
|
||||
playlist.PlayNext();
|
||||
}
|
||||
|
@ -29,7 +29,11 @@ namespace osu.Game.Screens
|
||||
|
||||
internal virtual bool HasLocalCursorDisplayed => false;
|
||||
|
||||
internal virtual bool AllowRulesetChange => true;
|
||||
/// <summary>
|
||||
/// Whether the beatmap or ruleset should be allowed to be changed by the user or game.
|
||||
/// Used to mark exclusive areas where this is strongly prohibited, like gameplay.
|
||||
/// </summary>
|
||||
internal virtual bool AllowBeatmapRulesetChange => true;
|
||||
|
||||
private readonly Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
@ -85,7 +89,13 @@ namespace osu.Game.Screens
|
||||
{
|
||||
if (!IsCurrentScreen) return;
|
||||
|
||||
ruleset.Disabled = !AllowRulesetChange;
|
||||
if (ParentScreen != null)
|
||||
{
|
||||
// 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.
|
||||
ruleset.Disabled = !AllowBeatmapRulesetChange;
|
||||
beatmap.Disabled = !AllowBeatmapRulesetChange;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnResuming(Screen last)
|
||||
|
@ -39,7 +39,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
public Action RestartRequested;
|
||||
|
||||
internal override bool AllowRulesetChange => false;
|
||||
internal override bool AllowBeatmapRulesetChange => false;
|
||||
|
||||
public bool HasFailed { get; private set; }
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Screens.Play
|
||||
private bool showOverlays = true;
|
||||
internal override bool ShowOverlays => showOverlays;
|
||||
|
||||
internal override bool AllowRulesetChange => false;
|
||||
internal override bool AllowBeatmapRulesetChange => false;
|
||||
|
||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
|
||||
|
||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Screens.Ranking
|
||||
|
||||
private ResultModeTabControl modeChangeButtons;
|
||||
|
||||
internal override bool AllowRulesetChange => false;
|
||||
internal override bool AllowBeatmapRulesetChange => false;
|
||||
|
||||
private Container currentPage;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user