From 7201cfe0b4b36eddad1188f7c94908ed1d1af8ae Mon Sep 17 00:00:00 2001 From: ekrctb Date: Mon, 19 Jul 2021 20:18:17 +0900 Subject: [PATCH] Move child drawable creation of `CatchPlayfield` from constructor to `load`. --- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 19538aacde..dcbac47505 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -16,6 +16,8 @@ namespace osu.Game.Rulesets.Catch.UI { public class CatchPlayfield : ScrollingPlayfield { + private readonly BeatmapDifficulty difficulty; + /// /// The width of the playfield. /// The horizontal movement of the catcher is confined in the area of this width. @@ -31,11 +33,17 @@ namespace osu.Game.Rulesets.Catch.UI // only check the X position; handle all vertical space. base.ReceivePositionalInputAt(new Vector2(screenSpacePos.X, ScreenSpaceDrawQuad.Centre.Y)); - internal readonly Catcher Catcher; + internal Catcher Catcher { get; private set; } - internal readonly CatcherArea CatcherArea; + internal CatcherArea CatcherArea { get; private set; } public CatchPlayfield(BeatmapDifficulty difficulty) + { + this.difficulty = difficulty; + } + + [BackgroundDependencyLoader] + private void load() { var trailContainer = new Container { @@ -49,7 +57,7 @@ namespace osu.Game.Rulesets.Catch.UI X = CENTER_X }; - InternalChildren = new[] + AddRangeInternal(new[] { droppedObjectContainer, Catcher.CreateProxiedContent(), @@ -64,12 +72,8 @@ namespace osu.Game.Rulesets.Catch.UI }, trailContainer, HitObjectContainer, - }; - } + }); - [BackgroundDependencyLoader] - private void load() - { RegisterPool(50); RegisterPool(50); RegisterPool(100);