1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 02:32:59 +08:00

Improve the initialisation logic of OsuGameBase.

This commit is contained in:
Dean Herbert 2016-10-16 17:33:53 +09:00
parent 7a4bbb6921
commit 4edefb935c

View File

@ -25,12 +25,23 @@ namespace osu.Game
public Options Options;
public APIAccess API;
protected override Container Content => ratioContainer?.IsLoaded == true ? ratioContainer : base.Content;
protected override Container Content => ratioContainer;
private RatioAdjust ratioContainer;
public CursorContainer Cursor;
public OsuGameBase()
{
AddInternal(ratioContainer = new RatioAdjust());
Children = new Drawable[]
{
Options = new Options(),
Cursor = new OsuCursorContainer()
};
}
public override void Load(BaseGame game)
{
base.Load(game);
@ -50,18 +61,6 @@ namespace osu.Game
Password = Config.Get<string>(OsuConfig.Password),
Token = Config.Get<string>(OsuConfig.Token)
};
Add(new Drawable[]
{
ratioContainer = new RatioAdjust
{
Children = new Drawable[]
{
Options = new Options(),
Cursor = new OsuCursorContainer()
}
}
});
}
protected override void Update()