mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 06:42:56 +08:00
Set children in constructor.
This commit is contained in:
parent
5eed07db57
commit
859a59a8ab
@ -42,27 +42,8 @@ namespace osu.Game.Overlays
|
||||
Anchor = Anchor.TopRight;//placeholder
|
||||
Origin = Anchor.TopRight;
|
||||
Position = new Vector2(10, 50);
|
||||
}
|
||||
|
||||
protected override void Load(BaseGame game)
|
||||
{
|
||||
base.Load(game);
|
||||
var osuGame = game as OsuGameBase;
|
||||
|
||||
if (osuGame != null)
|
||||
{
|
||||
if (database == null) database = osuGame.Beatmaps;
|
||||
trackManager = osuGame.Audio.Track;
|
||||
}
|
||||
|
||||
beatmapSource = osuGame?.Beatmap ?? new Bindable<WorkingBeatmap>();
|
||||
beatmapSource.ValueChanged += workingChanged;
|
||||
workingChanged();
|
||||
playList = database.GetAllWithChildren<BeatmapSetInfo>();
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
backgroundSprite = getScaledSprite(game.Textures.Get(@"Backgrounds/bg4")),//placeholder
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
@ -183,6 +164,26 @@ namespace osu.Game.Overlays
|
||||
};
|
||||
}
|
||||
|
||||
protected override void Load(BaseGame game)
|
||||
{
|
||||
base.Load(game);
|
||||
var osuGame = game as OsuGameBase;
|
||||
|
||||
if (osuGame != null)
|
||||
{
|
||||
if (database == null) database = osuGame.Beatmaps;
|
||||
trackManager = osuGame.Audio.Track;
|
||||
}
|
||||
|
||||
beatmapSource = osuGame?.Beatmap ?? new Bindable<WorkingBeatmap>();
|
||||
beatmapSource.ValueChanged += workingChanged;
|
||||
workingChanged();
|
||||
playList = database.GetAllWithChildren<BeatmapSetInfo>();
|
||||
|
||||
backgroundSprite = getScaledSprite(game.Textures.Get(@"Backgrounds/bg4"));
|
||||
AddInternal(backgroundSprite);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
Loading…
Reference in New Issue
Block a user