1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:17:26 +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)
{
AddTopLevel(new ParallaxContainer
AddInternal(new ParallaxContainer
{
Depth = float.MinValue,
Children = new[]
@ -51,7 +51,6 @@ namespace osu.Game.GameModes
});
}
base.OnEntering(last);
}

View File

@ -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)

View File

@ -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()

View File

@ -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;