mirror of
https://github.com/ppy/osu
synced 2024-12-23 23:33:36 +00:00
Fix slider approach circle proxies
This commit is contained in:
parent
8a284bacba
commit
3a1acf7b0a
@ -258,7 +258,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
}
|
||||
}
|
||||
|
||||
public Drawable ProxiedLayer => new Container(); // Todo:
|
||||
public Drawable ProxiedLayer => HeadCircle.ProxiedLayer;
|
||||
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Body.ReceivePositionalInputAt(screenSpacePos);
|
||||
}
|
||||
|
@ -57,21 +57,15 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
public override void Add(DrawableHitObject h)
|
||||
{
|
||||
h.OnNewResult += onNewResult;
|
||||
|
||||
if (h is IDrawableHitObjectWithProxiedApproach c)
|
||||
h.OnLoadComplete += d =>
|
||||
{
|
||||
var original = c.ProxiedLayer;
|
||||
|
||||
// Hitobjects only have lifetimes set on LoadComplete. For nested hitobjects (e.g. SliderHeads), this only happens when the parenting slider becomes visible.
|
||||
// This delegation is required to make sure that the approach circles for those not-yet-loaded objects aren't added prematurely.
|
||||
original.OnLoadComplete += addApproachCircleProxy;
|
||||
}
|
||||
if (d is IDrawableHitObjectWithProxiedApproach c)
|
||||
approachCircles.Add(c.ProxiedLayer.CreateProxy());
|
||||
};
|
||||
|
||||
base.Add(h);
|
||||
}
|
||||
|
||||
private void addApproachCircleProxy(Drawable d) => approachCircles.Add(d.CreateProxy());
|
||||
|
||||
public override void PostProcess()
|
||||
{
|
||||
connectionLayer.HitObjects = HitObjectContainer.Objects.Select(d => d.HitObject).OfType<OsuHitObject>();
|
||||
|
Loading…
Reference in New Issue
Block a user