Avoid using load to construct the drawable hierarchy whereever possible.

This commit is contained in:
Thomas Müller
2016-11-12 18:34:36 +01:00
parent 16dc74df5b
commit ac99e2d488
21 changed files with 159 additions and 194 deletions

View File

@ -37,10 +37,6 @@ namespace osu.Game
public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
private void Beatmap_ValueChanged(object sender, EventArgs e)
{
}
[BackgroundDependencyLoader]
private void load()
{
@ -65,15 +61,6 @@ namespace osu.Game
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-MediumItalic"));
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Black"));
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BlackItalic"));
AddInternal(ratioContainer = new RatioAdjust());
Children = new Drawable[]
{
Cursor = new OsuCursorContainer { Depth = float.MaxValue }
};
Beatmap.ValueChanged += Beatmap_ValueChanged;
OszArchiveReader.Register();
@ -85,6 +72,19 @@ namespace osu.Game
});
}
protected override void LoadComplete()
{
base.LoadComplete();
AddInternal(ratioContainer = new RatioAdjust
{
Children = new[]
{
Cursor = new OsuCursorContainer { Depth = float.MaxValue }
}
});
}
public override void SetHost(BasicGameHost host)
{
if (Config == null)