From d9486e790a1ca77e83d7c3aa6cc4b8b20011d3df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 9 Oct 2016 11:56:41 +0200 Subject: [PATCH] Use AddInternal instead of AddTopLevel. --- osu.Game/GameModes/OsuGameMode.cs | 3 +-- .../Graphics/Containers/ParallaxContainer.cs | 16 ++++++++-------- .../UserInterface/KeyCounterCollection.cs | 15 ++++++++------- osu.Game/OsuGameBase.cs | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/osu.Game/GameModes/OsuGameMode.cs b/osu.Game/GameModes/OsuGameMode.cs index d81d30f0d5..b0928d8214 100644 --- a/osu.Game/GameModes/OsuGameMode.cs +++ b/osu.Game/GameModes/OsuGameMode.cs @@ -41,7 +41,7 @@ namespace osu.Game.GameModes } else if (bg != null) { - AddTopLevel(new ParallaxContainer + AddInternal(new ParallaxContainer { Depth = float.MinValue, Children = new[] @@ -51,7 +51,6 @@ namespace osu.Game.GameModes }); } - base.OnEntering(last); } diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index 3c6cb18162..183b0c054a 100644 --- a/osu.Game/Graphics/Containers/ParallaxContainer.cs +++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs @@ -14,21 +14,21 @@ namespace osu.Game.Graphics.Containers public ParallaxContainer() { RelativeSizeAxes = Axes.Both; + AddInternal(content = new Container() + { + RelativeSizeAxes = Axes.Both, + Anchor = Anchor.Centre, + Origin = Anchor.Centre + }); } - private Container content = new Container() - { - RelativeSizeAxes = Axes.Both, - Anchor = Anchor.Centre, - Origin = Anchor.Centre - }; + private Container content; - protected override Container AddTarget => content; + protected override Container Content => content; public override void Load() { base.Load(); - Add(content); } protected override bool OnMouseMove(InputState state) diff --git a/osu.Game/Graphics/UserInterface/KeyCounterCollection.cs b/osu.Game/Graphics/UserInterface/KeyCounterCollection.cs index 288d1e2018..c9d22d2f06 100644 --- a/osu.Game/Graphics/UserInterface/KeyCounterCollection.cs +++ b/osu.Game/Graphics/UserInterface/KeyCounterCollection.cs @@ -22,18 +22,19 @@ namespace osu.Game.Graphics.UserInterface set { foreach (var k in value) - AddKey(k); + addKey(k); + + Children = value; } } - public void AddKey(KeyCounter key) + private void addKey(KeyCounter key) { counters.Add(key); - key.IsCounting = this.IsCounting; - key.FadeTime = this.FadeTime; - key.KeyDownTextColor = this.KeyDownTextColor; - key.KeyUpTextColor = this.KeyUpTextColor; - base.Add(key); + key.IsCounting = IsCounting; + key.FadeTime = FadeTime; + key.KeyDownTextColor = KeyDownTextColor; + key.KeyUpTextColor = KeyUpTextColor; } public void ResetCount() diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 0f0a9116a0..bd3990d5ef 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -21,7 +21,7 @@ namespace osu.Game public Options Options; public APIAccess API; - protected override Container AddTarget => ratioContainer?.IsLoaded == true ? ratioContainer : base.AddTarget; + protected override Container Content => ratioContainer?.IsLoaded == true ? ratioContainer : base.Content; private RatioAdjust ratioContainer;