mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 05:52:54 +08:00
Merge branch 'master' into song-selet-enumerable
This commit is contained in:
commit
76567ae98b
@ -209,8 +209,11 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
// if the player never got pushed, we should explicitly dispose it.
|
if (isDisposing)
|
||||||
loadTask?.ContinueWith(_ => player.Dispose());
|
{
|
||||||
|
// if the player never got pushed, we should explicitly dispose it.
|
||||||
|
loadTask?.ContinueWith(_ => player.Dispose());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class BeatmapMetadataDisplay : Container
|
private class BeatmapMetadataDisplay : Container
|
||||||
|
@ -51,7 +51,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
|
|
||||||
if (songSelect != null)
|
if (songSelect != null)
|
||||||
{
|
{
|
||||||
startRequested = songSelect.FinaliseSelection;
|
startRequested = b => songSelect.FinaliseSelection(b);
|
||||||
editRequested = songSelect.Edit;
|
editRequested = songSelect.Edit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
protected override bool ShowFooter => false;
|
protected override bool ShowFooter => false;
|
||||||
|
|
||||||
protected override bool OnSelectionFinalised()
|
protected override bool OnStart()
|
||||||
{
|
{
|
||||||
Exit();
|
Exit();
|
||||||
return true;
|
return true;
|
||||||
|
@ -5,7 +5,7 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
public class MatchSongSelect : SongSelect
|
public class MatchSongSelect : SongSelect
|
||||||
{
|
{
|
||||||
protected override bool OnSelectionFinalised()
|
protected override bool OnStart()
|
||||||
{
|
{
|
||||||
Schedule(() =>
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
|
@ -137,7 +137,7 @@ namespace osu.Game.Screens.Select
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnSelectionFinalised()
|
protected override bool OnStart()
|
||||||
{
|
{
|
||||||
if (player != null) return false;
|
if (player != null) return false;
|
||||||
|
|
||||||
|
@ -222,7 +222,8 @@ namespace osu.Game.Screens.Select
|
|||||||
/// Call to make a selection and perform the default action for this SongSelect.
|
/// Call to make a selection and perform the default action for this SongSelect.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="beatmap">An optional beatmap to override the current carousel selection.</param>
|
/// <param name="beatmap">An optional beatmap to override the current carousel selection.</param>
|
||||||
public void FinaliseSelection(BeatmapInfo beatmap = null)
|
/// <param name="performStartAction">Whether to trigger <see cref="OnStart"/>.</param>
|
||||||
|
public void FinaliseSelection(BeatmapInfo beatmap = null, bool performStartAction = true)
|
||||||
{
|
{
|
||||||
// if we have a pending filter operation, we want to run it now.
|
// if we have a pending filter operation, we want to run it now.
|
||||||
// it could change selection (ie. if the ruleset has been changed).
|
// it could change selection (ie. if the ruleset has been changed).
|
||||||
@ -238,14 +239,15 @@ namespace osu.Game.Screens.Select
|
|||||||
selectionChangedDebounce = null;
|
selectionChangedDebounce = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
OnSelectionFinalised();
|
if (performStartAction)
|
||||||
|
OnStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when a selection is made.
|
/// Called when a selection is made.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>If a resultant action occurred that takes the user away from SongSelect.</returns>
|
/// <returns>If a resultant action occurred that takes the user away from SongSelect.</returns>
|
||||||
protected abstract bool OnSelectionFinalised();
|
protected abstract bool OnStart();
|
||||||
|
|
||||||
private ScheduledDelegate selectionChangedDebounce;
|
private ScheduledDelegate selectionChangedDebounce;
|
||||||
|
|
||||||
@ -390,7 +392,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
protected override bool OnExiting(Screen next)
|
protected override bool OnExiting(Screen next)
|
||||||
{
|
{
|
||||||
FinaliseSelection();
|
FinaliseSelection(performStartAction: false);
|
||||||
|
|
||||||
beatmapInfoWedge.State = Visibility.Hidden;
|
beatmapInfoWedge.State = Visibility.Hidden;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user