mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Improve the initialisation logic of OsuGameBase.
This commit is contained in:
parent
7a4bbb6921
commit
4edefb935c
@ -25,12 +25,23 @@ namespace osu.Game
|
|||||||
public Options Options;
|
public Options Options;
|
||||||
public APIAccess API;
|
public APIAccess API;
|
||||||
|
|
||||||
protected override Container Content => ratioContainer?.IsLoaded == true ? ratioContainer : base.Content;
|
protected override Container Content => ratioContainer;
|
||||||
|
|
||||||
private RatioAdjust ratioContainer;
|
private RatioAdjust ratioContainer;
|
||||||
|
|
||||||
public CursorContainer Cursor;
|
public CursorContainer Cursor;
|
||||||
|
|
||||||
|
public OsuGameBase()
|
||||||
|
{
|
||||||
|
AddInternal(ratioContainer = new RatioAdjust());
|
||||||
|
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
Options = new Options(),
|
||||||
|
Cursor = new OsuCursorContainer()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public override void Load(BaseGame game)
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load(game);
|
base.Load(game);
|
||||||
@ -50,18 +61,6 @@ namespace osu.Game
|
|||||||
Password = Config.Get<string>(OsuConfig.Password),
|
Password = Config.Get<string>(OsuConfig.Password),
|
||||||
Token = Config.Get<string>(OsuConfig.Token)
|
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()
|
protected override void Update()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user