mirror of
https://github.com/ppy/osu
synced 2024-12-16 03:45:46 +00:00
Allow to set database of music controller.
This commit is contained in:
parent
6482184a09
commit
3e30935d10
@ -28,13 +28,20 @@ namespace osu.Game.Overlays
|
||||
private SpriteText title, artist;
|
||||
private OsuGameBase osuGame;
|
||||
private List<BeatmapSetInfo> playList;
|
||||
private BeatmapDatabase database;
|
||||
private BeatmapSetInfo currentPlay;
|
||||
public AudioTrack CurrentTrack { get; set; }//TODO:gets exterally
|
||||
|
||||
public MusicController(BeatmapDatabase db = null)
|
||||
{
|
||||
database = db;
|
||||
}
|
||||
public override void Load(BaseGame game)
|
||||
{
|
||||
base.Load(game);
|
||||
osuGame = game as OsuGameBase;
|
||||
playList = osuGame.Beatmaps.Query<BeatmapSetInfo>().ToList();
|
||||
if (database == null) database = osuGame.Beatmaps;
|
||||
playList = database.Query<BeatmapSetInfo>().ToList();
|
||||
currentPlay = playList.FirstOrDefault();
|
||||
Width = 400;
|
||||
Height = 130;
|
||||
|
Loading…
Reference in New Issue
Block a user