Store judgement directly in hit explosion entry

This commit is contained in:
Bartłomiej Dach 2021-07-25 17:19:51 +02:00
parent a1f50e39aa
commit 95a58ca366
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
3 changed files with 28 additions and 12 deletions

View File

@ -87,11 +87,11 @@ namespace osu.Game.Rulesets.Catch.Skinning.Default
return;
X = entry.Position;
Scale = new Vector2(entry.Scale);
Scale = new Vector2(entry.HitObject.Scale);
setColour(entry.ObjectColour);
using (BeginAbsoluteSequence(entry.LifetimeStart))
applyTransforms(entry.RNGSeed);
applyTransforms(entry.HitObject.RandomSeed);
}
private void applyTransforms(int randomSeed)

View File

@ -216,7 +216,7 @@ namespace osu.Game.Rulesets.Catch.UI
placeCaughtObject(palpableObject, positionInStack);
if (hitLighting.Value)
addLighting(hitObject, positionInStack.X, drawableObject.AccentColour.Value);
addLighting(result, drawableObject.AccentColour.Value, positionInStack.X);
}
// droplet doesn't affect the catcher state
@ -365,8 +365,8 @@ namespace osu.Game.Rulesets.Catch.UI
return position;
}
private void addLighting(CatchHitObject hitObject, float x, Color4 colour) =>
hitExplosionContainer.Add(new HitExplosionEntry(Time.Current, x, hitObject.Scale, colour, hitObject.RandomSeed));
private void addLighting(JudgementResult judgementResult, Color4 colour, float x) =>
hitExplosionContainer.Add(new HitExplosionEntry(judgementResult, colour, x, Time.Current));
private CaughtObject getCaughtObject(PalpableCatchHitObject source)
{

View File

@ -2,24 +2,40 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics.Performance;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Judgements;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Catch.UI
{
public class HitExplosionEntry : LifetimeEntry
{
public readonly float Position;
public readonly float Scale;
public readonly Color4 ObjectColour;
public readonly int RNGSeed;
/// <summary>
/// The judgement result that triggered this explosion.
/// </summary>
public JudgementResult JudgementResult { get; }
public HitExplosionEntry(double startTime, float position, float scale, Color4 objectColour, int rngSeed)
/// <summary>
/// The hitobject which triggered this explosion.
/// </summary>
public CatchHitObject HitObject => (CatchHitObject)JudgementResult.HitObject;
/// <summary>
/// The accent colour of the object caught.
/// </summary>
public Color4 ObjectColour { get; }
/// <summary>
/// The position at which the object was caught.
/// </summary>
public float Position { get; }
public HitExplosionEntry(JudgementResult judgementResult, Color4 objectColour, float position, double startTime)
{
LifetimeStart = startTime;
Position = position;
Scale = scale;
JudgementResult = judgementResult;
ObjectColour = objectColour;
RNGSeed = rngSeed;
}
}
}