mirror of
https://github.com/osukey/osukey.git
synced 2025-05-17 11:37:32 +09:00
Merge pull request #14092 from bdach/proxied-judgement-layer-ordering
Ensure proxied judgement content is correctly depth-ordered
This commit is contained in:
commit
cd0e7223a6
@ -104,7 +104,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
|
|
||||||
private void onJudgementLoaded(DrawableOsuJudgement judgement)
|
private void onJudgementLoaded(DrawableOsuJudgement judgement)
|
||||||
{
|
{
|
||||||
judgementAboveHitObjectLayer.Add(judgement.GetProxyAboveHitObjectsContent());
|
judgementAboveHitObjectLayer.Add(judgement.ProxiedAboveHitObjectsContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
@ -150,6 +150,10 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
DrawableOsuJudgement explosion = poolDictionary[result.Type].Get(doj => doj.Apply(result, judgedObject));
|
DrawableOsuJudgement explosion = poolDictionary[result.Type].Get(doj => doj.Apply(result, judgedObject));
|
||||||
|
|
||||||
judgementLayer.Add(explosion);
|
judgementLayer.Add(explosion);
|
||||||
|
|
||||||
|
// the proxied content is added to judgementAboveHitObjectLayer once, on first load, and never removed from it.
|
||||||
|
// ensure that ordering is consistent with expectations (latest judgement should be front-most).
|
||||||
|
judgementAboveHitObjectLayer.ChangeChildDepth(explosion.ProxiedAboveHitObjectsContent, (float)-result.TimeAbsolute);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => HitObjectContainer.ReceivePositionalInputAt(screenSpacePos);
|
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => HitObjectContainer.ReceivePositionalInputAt(screenSpacePos);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -31,6 +32,9 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
|
|
||||||
private readonly Container aboveHitObjectsContent;
|
private readonly Container aboveHitObjectsContent;
|
||||||
|
|
||||||
|
private readonly Lazy<Drawable> proxiedAboveHitObjectsContent;
|
||||||
|
public Drawable ProxiedAboveHitObjectsContent => proxiedAboveHitObjectsContent.Value;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a drawable which visualises a <see cref="Judgements.Judgement"/>.
|
/// Creates a drawable which visualises a <see cref="Judgements.Judgement"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -52,6 +56,8 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
Depth = float.MinValue,
|
Depth = float.MinValue,
|
||||||
RelativeSizeAxes = Axes.Both
|
RelativeSizeAxes = Axes.Both
|
||||||
});
|
});
|
||||||
|
|
||||||
|
proxiedAboveHitObjectsContent = new Lazy<Drawable>(() => aboveHitObjectsContent.CreateProxy());
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -60,8 +66,6 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
prepareDrawables();
|
prepareDrawables();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Drawable GetProxyAboveHitObjectsContent() => aboveHitObjectsContent.CreateProxy();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Apply top-level animations to the current judgement when successfully hit.
|
/// Apply top-level animations to the current judgement when successfully hit.
|
||||||
/// If displaying components which require lifetime extensions, manually adjusting <see cref="Drawable.LifetimeEnd"/> is required.
|
/// If displaying components which require lifetime extensions, manually adjusting <see cref="Drawable.LifetimeEnd"/> is required.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user