mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:37:28 +08:00
Fix incorrect usage of InternalChildren
Could cause overwriting of components added by base DrawableHitObjcet class (such as samples)
This commit is contained in:
parent
c97116c91a
commit
39df8cce19
@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||
Origin = Anchor.BottomLeft;
|
||||
X = 0;
|
||||
|
||||
InternalChild = bananaContainer = new Container { RelativeSizeAxes = Axes.Both };
|
||||
AddInternal(bananaContainer = new Container { RelativeSizeAxes = Axes.Both });
|
||||
|
||||
foreach (var b in s.NestedHitObjects.Cast<Banana>())
|
||||
AddNested(getVisualRepresentation?.Invoke(b));
|
||||
|
@ -26,10 +26,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
InternalChild = pulp = new Pulp
|
||||
{
|
||||
Size = Size
|
||||
};
|
||||
AddInternal(pulp = new Pulp { Size = Size });
|
||||
}
|
||||
|
||||
public override Color4 AccentColour
|
||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||
// todo: this should come from the skin.
|
||||
AccentColour = colourForRepresentation(HitObject.VisualRepresentation);
|
||||
|
||||
InternalChildren = new[]
|
||||
AddRangeInternal(new[]
|
||||
{
|
||||
createPulp(HitObject.VisualRepresentation),
|
||||
border = new Circle
|
||||
@ -70,7 +70,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
if (HitObject.HyperDash)
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||
Origin = Anchor.BottomLeft;
|
||||
X = 0;
|
||||
|
||||
InternalChild = dropletContainer = new Container { RelativeSizeAxes = Axes.Both, };
|
||||
AddInternal(dropletContainer = new Container { RelativeSizeAxes = Axes.Both, });
|
||||
|
||||
foreach (var o in s.NestedHitObjects.Cast<CatchHitObject>())
|
||||
AddNested(getVisualRepresentation?.Invoke(o));
|
||||
|
@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
AddRangeInternal(new Drawable[]
|
||||
{
|
||||
bodyPiece = new BodyPiece
|
||||
{
|
||||
@ -67,7 +67,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
foreach (var tick in tickContainer)
|
||||
AddNested(tick);
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Size = new Vector2(1);
|
||||
|
||||
InternalChildren = new[]
|
||||
AddRangeInternal(new[]
|
||||
{
|
||||
glowContainer = new CircularContainer
|
||||
{
|
||||
@ -51,7 +51,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public override Color4 AccentColour
|
||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
CornerRadius = 5;
|
||||
Masking = true;
|
||||
|
||||
InternalChild = headPiece = new NotePiece();
|
||||
AddInternal(headPiece = new NotePiece());
|
||||
}
|
||||
|
||||
protected override void OnDirectionChanged(ValueChangedEvent<ScrollingDirection> e)
|
||||
|
@ -44,17 +44,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
Width = tracker_width;
|
||||
|
||||
InternalChildren = new[]
|
||||
AddInternal(Tracker = new Box
|
||||
{
|
||||
Tracker = new Box
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
EdgeSmoothness = new Vector2(0.5f, 0),
|
||||
Alpha = 0.75f
|
||||
}
|
||||
};
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
EdgeSmoothness = new Vector2(0.5f, 0),
|
||||
Alpha = 0.75f
|
||||
});
|
||||
}
|
||||
|
||||
protected override void UpdateState(ArmedState state)
|
||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
protected DrawableTaikoHitObject(TaikoHitObject hitObject)
|
||||
: base(hitObject)
|
||||
{
|
||||
InternalChildren = new[]
|
||||
AddRangeInternal(new[]
|
||||
{
|
||||
nonProxiedContent = new Container
|
||||
{
|
||||
@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
Child = Content = new Container { RelativeSizeAxes = Axes.Both }
|
||||
},
|
||||
proxiedContent = new ProxiedContentContainer { RelativeSizeAxes = Axes.Both }
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -170,12 +170,12 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
InternalChild = new Box
|
||||
AddInternal(new Box
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both
|
||||
};
|
||||
});
|
||||
|
||||
switch (direction)
|
||||
{
|
||||
@ -205,7 +205,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
Origin = Anchor.Centre;
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
||||
InternalChild = new Box { Size = new Vector2(75) };
|
||||
AddInternal(new Box { Size = new Vector2(75) });
|
||||
}
|
||||
|
||||
protected override void UpdateState(ArmedState state)
|
||||
|
Loading…
Reference in New Issue
Block a user