mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 15:22:55 +08:00
Move spinner completion info into judgement
This commit is contained in:
parent
af392e3995
commit
727a886fb3
@ -38,6 +38,12 @@ namespace osu.Game.Rulesets.Osu.Judgements
|
||||
/// </example>
|
||||
public float RateAdjustedRotation;
|
||||
|
||||
/// <summary>
|
||||
/// Time instant at which the spinner has been completed (the user has executed all required spins).
|
||||
/// Will be null if all required spins haven't been completed.
|
||||
/// </summary>
|
||||
public double? TimeCompleted;
|
||||
|
||||
public OsuSpinnerJudgementResult(HitObject hitObject, Judgement judgement)
|
||||
: base(hitObject, judgement)
|
||||
{
|
||||
|
@ -211,7 +211,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
{
|
||||
if (Time.Current < HitObject.StartTime) return;
|
||||
|
||||
RotationTracker.Complete.Value = Progress >= 1;
|
||||
if (Progress >= 1)
|
||||
Result.TimeCompleted ??= Time.Current;
|
||||
|
||||
if (userTriggered || Time.Current < HitObject.EndTime)
|
||||
return;
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -28,6 +29,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
private SpinnerTicks ticks;
|
||||
|
||||
private int wholeRotationCount;
|
||||
private readonly BindableBool complete = new BindableBool();
|
||||
|
||||
private SpinnerFill fill;
|
||||
private Container mainContainer;
|
||||
@ -89,7 +91,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
drawableSpinner.RotationTracker.Complete.BindValueChanged(complete => updateComplete(complete.NewValue, 200));
|
||||
complete.BindValueChanged(complete => updateComplete(complete.NewValue, 200));
|
||||
drawableSpinner.ApplyCustomUpdateState += updateStateTransforms;
|
||||
|
||||
updateStateTransforms(drawableSpinner, drawableSpinner.State.Value);
|
||||
@ -99,7 +101,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
base.Update();
|
||||
|
||||
if (drawableSpinner.RotationTracker.Complete.Value)
|
||||
complete.Value = Time.Current >= drawableSpinner.Result.TimeCompleted;
|
||||
|
||||
if (complete.Value)
|
||||
{
|
||||
if (checkNewRotationCount)
|
||||
{
|
||||
|
@ -30,8 +30,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
public bool Tracking { get; set; }
|
||||
|
||||
public readonly BindableBool Complete = new BindableBool();
|
||||
|
||||
/// <summary>
|
||||
/// Whether the spinning is spinning at a reasonable speed to be considered visually spinning.
|
||||
/// </summary>
|
||||
|
@ -60,7 +60,6 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
completed.BindTo(DrawableSpinner.RotationTracker.Complete);
|
||||
completed.BindValueChanged(onCompletedChanged, true);
|
||||
|
||||
DrawableSpinner.ApplyCustomUpdateState += UpdateStateTransforms;
|
||||
@ -93,6 +92,12 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
completed.Value = Time.Current >= DrawableSpinner.Result.TimeCompleted;
|
||||
}
|
||||
|
||||
protected virtual void UpdateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
|
||||
{
|
||||
switch (drawableHitObject)
|
||||
|
Loading…
Reference in New Issue
Block a user