Update to latest DI stuff

This commit is contained in:
Drew DeVault
2016-11-10 17:40:42 -05:00
parent 7327db307b
commit 0d4560a054
24 changed files with 481 additions and 436 deletions

View File

@ -7,6 +7,8 @@ using System.Threading.Tasks;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Track;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
@ -174,21 +176,16 @@ namespace osu.Game.Overlays
};
}
protected override void Load(BaseGame game)
[Initializer(permitNulls: true)]
private void Load(OsuGame osuGame, BeatmapDatabase beatmaps, AudioManager audio, TextureStore textures)
{
base.Load(game);
var osuGame = game as OsuGameBase;
if (osuGame != null)
{
if (database == null) database = osuGame.Beatmaps;
trackManager = osuGame.Audio.Track;
}
if (database == null) database = beatmaps;
trackManager = audio.Track;
beatmapSource = osuGame?.Beatmap ?? new Bindable<WorkingBeatmap>();
playList = database.GetAllWithChildren<BeatmapSetInfo>();
backgroundSprite = getScaledSprite(fallbackTexture = game.Textures.Get(@"Backgrounds/bg4"));
backgroundSprite = getScaledSprite(fallbackTexture = textures.Get(@"Backgrounds/bg4"));
AddInternal(backgroundSprite);
}