mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Move player specific stuff to derived PlaySongSelect.
This commit is contained in:
@ -34,7 +34,7 @@ using osu.Game.Screens.Select.Options;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
{
|
||||
public class SongSelect : OsuScreen
|
||||
public abstract class SongSelect : OsuScreen
|
||||
{
|
||||
private Bindable<PlayMode> playMode = new Bindable<PlayMode>();
|
||||
private BeatmapDatabase database;
|
||||
@ -60,8 +60,6 @@ namespace osu.Game.Screens.Select
|
||||
private BeatmapOptionsOverlay beatmapOptions;
|
||||
private Footer footer;
|
||||
|
||||
private OsuScreen player;
|
||||
|
||||
private FilterControl filter;
|
||||
public FilterControl Filter
|
||||
{
|
||||
@ -158,15 +156,10 @@ namespace osu.Game.Screens.Select
|
||||
OnBack = Exit,
|
||||
OnStart = () =>
|
||||
{
|
||||
if (player != null || Beatmap == null)
|
||||
return;
|
||||
if (Beatmap == null) return;
|
||||
|
||||
Beatmap.PreferredPlayMode = playMode.Value;
|
||||
|
||||
(player = new PlayerLoader(new Player
|
||||
{
|
||||
Beatmap = Beatmap, //eagerly set this so it's present before push.
|
||||
})).LoadAsync(Game, l => Push(player));
|
||||
OnSelected(Beatmap);
|
||||
}
|
||||
},
|
||||
};
|
||||
@ -196,6 +189,8 @@ namespace osu.Game.Screens.Select
|
||||
Task.Factory.StartNew(() => addBeatmapSets(game, initialAddSetsTask.Token), initialAddSetsTask.Token);
|
||||
}
|
||||
|
||||
protected abstract void OnSelected(WorkingBeatmap beatmap);
|
||||
|
||||
private ScheduledDelegate filterTask;
|
||||
|
||||
private void filterChanged(bool debounce = true, bool eagerSelection = true)
|
||||
@ -268,8 +263,6 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
protected override void OnResuming(Screen last)
|
||||
{
|
||||
player = null;
|
||||
|
||||
changeBackground(Beatmap);
|
||||
ensurePlayingSelected();
|
||||
base.OnResuming(last);
|
||||
|
Reference in New Issue
Block a user