1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 21:53:22 +08:00

Use AddInternal instead of AddTopLevel.

This commit is contained in:
Thomas Müller 2016-10-09 11:56:41 +02:00 committed by Dean Herbert
parent bcb5a02221
commit dd04b33232
4 changed files with 18 additions and 18 deletions

View File

@ -41,7 +41,7 @@ namespace osu.Game.GameModes
} }
else if (bg != null) else if (bg != null)
{ {
AddTopLevel(new ParallaxContainer AddInternal(new ParallaxContainer
{ {
Depth = float.MinValue, Depth = float.MinValue,
Children = new[] Children = new[]
@ -51,7 +51,6 @@ namespace osu.Game.GameModes
}); });
} }
base.OnEntering(last); base.OnEntering(last);
} }

View File

@ -14,21 +14,21 @@ namespace osu.Game.Graphics.Containers
public ParallaxContainer() public ParallaxContainer()
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
} AddInternal(content = new Container()
private Container content = new Container()
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre Origin = Anchor.Centre
}; });
}
protected override Container AddTarget => content; private Container content;
protected override Container Content => content;
public override void Load() public override void Load()
{ {
base.Load(); base.Load();
Add(content);
} }
protected override bool OnMouseMove(InputState state) protected override bool OnMouseMove(InputState state)

View File

@ -22,18 +22,19 @@ namespace osu.Game.Graphics.UserInterface
set set
{ {
foreach (var k in value) foreach (var k in value)
AddKey(k); addKey(k);
Children = value;
} }
} }
public void AddKey(KeyCounter key) private void addKey(KeyCounter key)
{ {
counters.Add(key); counters.Add(key);
key.IsCounting = this.IsCounting; key.IsCounting = IsCounting;
key.FadeTime = this.FadeTime; key.FadeTime = FadeTime;
key.KeyDownTextColor = this.KeyDownTextColor; key.KeyDownTextColor = KeyDownTextColor;
key.KeyUpTextColor = this.KeyUpTextColor; key.KeyUpTextColor = KeyUpTextColor;
base.Add(key);
} }
public void ResetCount() public void ResetCount()

View File

@ -21,7 +21,7 @@ namespace osu.Game
public Options Options; public Options Options;
public APIAccess API; 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; private RatioAdjust ratioContainer;