mirror of
https://github.com/osukey/osukey.git
synced 2025-05-06 06:07:26 +09: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);
|
var trackData = getReader()?.GetStream(Metadata.AudioFile);
|
||||||
return trackData == null ? null : new TrackBass(trackData);
|
return trackData == null ? null : new TrackBass(trackData);
|
||||||
}
|
}
|
||||||
catch { return null; }
|
catch { return new TrackVirtual(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,9 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
Width = 400;
|
Width = 400;
|
||||||
Margin = new MarginPadding(10);
|
Margin = new MarginPadding(10);
|
||||||
|
|
||||||
|
// required to let MusicController handle beatmap cycling.
|
||||||
|
AlwaysPresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnDragStart(InputState state) => true;
|
protected override bool OnDragStart(InputState state) => true;
|
||||||
@ -252,12 +255,16 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private void prev()
|
private void prev()
|
||||||
{
|
{
|
||||||
|
if (beatmapBacking.Disabled) return;
|
||||||
|
|
||||||
queuedDirection = TransformDirection.Prev;
|
queuedDirection = TransformDirection.Prev;
|
||||||
playlist.PlayPrevious();
|
playlist.PlayPrevious();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void next()
|
private void next()
|
||||||
{
|
{
|
||||||
|
if (beatmapBacking.Disabled) return;
|
||||||
|
|
||||||
queuedDirection = TransformDirection.Next;
|
queuedDirection = TransformDirection.Next;
|
||||||
playlist.PlayNext();
|
playlist.PlayNext();
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,11 @@ namespace osu.Game.Screens
|
|||||||
|
|
||||||
internal virtual bool HasLocalCursorDisplayed => false;
|
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>();
|
private readonly Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
|
||||||
|
|
||||||
@ -85,7 +89,13 @@ namespace osu.Game.Screens
|
|||||||
{
|
{
|
||||||
if (!IsCurrentScreen) return;
|
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)
|
protected override void OnResuming(Screen last)
|
||||||
|
@ -39,7 +39,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
public Action RestartRequested;
|
public Action RestartRequested;
|
||||||
|
|
||||||
internal override bool AllowRulesetChange => false;
|
internal override bool AllowBeatmapRulesetChange => false;
|
||||||
|
|
||||||
public bool HasFailed { get; private set; }
|
public bool HasFailed { get; private set; }
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Screens.Play
|
|||||||
private bool showOverlays = true;
|
private bool showOverlays = true;
|
||||||
internal override bool ShowOverlays => showOverlays;
|
internal override bool ShowOverlays => showOverlays;
|
||||||
|
|
||||||
internal override bool AllowRulesetChange => false;
|
internal override bool AllowBeatmapRulesetChange => false;
|
||||||
|
|
||||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
|
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
|
|
||||||
private ResultModeTabControl modeChangeButtons;
|
private ResultModeTabControl modeChangeButtons;
|
||||||
|
|
||||||
internal override bool AllowRulesetChange => false;
|
internal override bool AllowBeatmapRulesetChange => false;
|
||||||
|
|
||||||
private Container currentPage;
|
private Container currentPage;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user