Merge pull request #9778 from smoogipoo/spinner-behind-circles

Always place spinners behind hitcircles/sliders
This commit is contained in:
Dean Herbert 2020-08-05 18:16:10 +09:00 committed by GitHub
commit 93f8dddb20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 4 deletions

View File

@ -23,7 +23,8 @@ namespace osu.Game.Rulesets.Osu.UI
{
public class OsuPlayfield : Playfield
{
private readonly ApproachCircleProxyContainer approachCircles;
private readonly ProxyContainer approachCircles;
private readonly ProxyContainer spinnerProxies;
private readonly JudgementContainer<DrawableOsuJudgement> judgementLayer;
private readonly FollowPointRenderer followPoints;
private readonly OrderedHitPolicy hitPolicy;
@ -38,6 +39,10 @@ public OsuPlayfield()
{
InternalChildren = new Drawable[]
{
spinnerProxies = new ProxyContainer
{
RelativeSizeAxes = Axes.Both
},
followPoints = new FollowPointRenderer
{
RelativeSizeAxes = Axes.Both,
@ -54,7 +59,7 @@ public OsuPlayfield()
{
Child = HitObjectContainer,
},
approachCircles = new ApproachCircleProxyContainer
approachCircles = new ProxyContainer
{
RelativeSizeAxes = Axes.Both,
Depth = -1,
@ -76,6 +81,9 @@ public override void Add(DrawableHitObject h)
h.OnNewResult += onNewResult;
h.OnLoadComplete += d =>
{
if (d is DrawableSpinner)
spinnerProxies.Add(d.CreateProxy());
if (d is IDrawableHitObjectWithProxiedApproach c)
approachCircles.Add(c.ProxiedLayer.CreateProxy());
};
@ -113,9 +121,9 @@ private void onNewResult(DrawableHitObject judgedObject, JudgementResult result)
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => HitObjectContainer.ReceivePositionalInputAt(screenSpacePos);
private class ApproachCircleProxyContainer : LifetimeManagementContainer
private class ProxyContainer : LifetimeManagementContainer
{
public void Add(Drawable approachCircleProxy) => AddInternal(approachCircleProxy);
public void Add(Drawable proxy) => AddInternal(proxy);
}
private class DrawableJudgementPool : DrawablePool<DrawableOsuJudgement>