1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 23:43:03 +08:00

Prevent DrawableJudgement from removing other children

This commit is contained in:
Bartłomiej Dach 2020-07-26 23:22:31 +02:00
parent 21ae33e284
commit 5fc7039bf2

View File

@ -130,11 +130,16 @@ namespace osu.Game.Rulesets.Judgements
if (type == currentDrawableType)
return;
InternalChild = JudgementBody = new Container
// sub-classes might have added their own children that would be removed here if .InternalChild was used.
if (JudgementBody != null)
RemoveInternal(JudgementBody);
AddInternal(JudgementBody = new Container
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Depth = -float.MaxValue,
Child = bodyDrawable = new SkinnableDrawable(new GameplaySkinComponent<HitResult>(type), _ => JudgementText = new OsuSpriteText
{
Text = type.GetDescription().ToUpperInvariant(),
@ -142,7 +147,7 @@ namespace osu.Game.Rulesets.Judgements
Colour = colours.ForHitResult(type),
Scale = new Vector2(0.85f, 1),
}, confineMode: ConfineMode.NoScaling)
};
});
currentDrawableType = type;
}