mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 16:12:54 +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>
|
/// </example>
|
||||||
public float RateAdjustedRotation;
|
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)
|
public OsuSpinnerJudgementResult(HitObject hitObject, Judgement judgement)
|
||||||
: base(hitObject, judgement)
|
: base(hitObject, judgement)
|
||||||
{
|
{
|
||||||
|
@ -211,7 +211,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
if (Time.Current < HitObject.StartTime) return;
|
if (Time.Current < HitObject.StartTime) return;
|
||||||
|
|
||||||
RotationTracker.Complete.Value = Progress >= 1;
|
if (Progress >= 1)
|
||||||
|
Result.TimeCompleted ??= Time.Current;
|
||||||
|
|
||||||
if (userTriggered || Time.Current < HitObject.EndTime)
|
if (userTriggered || Time.Current < HitObject.EndTime)
|
||||||
return;
|
return;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -28,6 +29,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
private SpinnerTicks ticks;
|
private SpinnerTicks ticks;
|
||||||
|
|
||||||
private int wholeRotationCount;
|
private int wholeRotationCount;
|
||||||
|
private readonly BindableBool complete = new BindableBool();
|
||||||
|
|
||||||
private SpinnerFill fill;
|
private SpinnerFill fill;
|
||||||
private Container mainContainer;
|
private Container mainContainer;
|
||||||
@ -89,7 +91,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
drawableSpinner.RotationTracker.Complete.BindValueChanged(complete => updateComplete(complete.NewValue, 200));
|
complete.BindValueChanged(complete => updateComplete(complete.NewValue, 200));
|
||||||
drawableSpinner.ApplyCustomUpdateState += updateStateTransforms;
|
drawableSpinner.ApplyCustomUpdateState += updateStateTransforms;
|
||||||
|
|
||||||
updateStateTransforms(drawableSpinner, drawableSpinner.State.Value);
|
updateStateTransforms(drawableSpinner, drawableSpinner.State.Value);
|
||||||
@ -99,7 +101,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
if (drawableSpinner.RotationTracker.Complete.Value)
|
complete.Value = Time.Current >= drawableSpinner.Result.TimeCompleted;
|
||||||
|
|
||||||
|
if (complete.Value)
|
||||||
{
|
{
|
||||||
if (checkNewRotationCount)
|
if (checkNewRotationCount)
|
||||||
{
|
{
|
||||||
|
@ -30,8 +30,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
|
|
||||||
public bool Tracking { get; set; }
|
public bool Tracking { get; set; }
|
||||||
|
|
||||||
public readonly BindableBool Complete = new BindableBool();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the spinning is spinning at a reasonable speed to be considered visually spinning.
|
/// Whether the spinning is spinning at a reasonable speed to be considered visually spinning.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -60,7 +60,6 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
completed.BindTo(DrawableSpinner.RotationTracker.Complete);
|
|
||||||
completed.BindValueChanged(onCompletedChanged, true);
|
completed.BindValueChanged(onCompletedChanged, true);
|
||||||
|
|
||||||
DrawableSpinner.ApplyCustomUpdateState += UpdateStateTransforms;
|
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)
|
protected virtual void UpdateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
|
||||||
{
|
{
|
||||||
switch (drawableHitObject)
|
switch (drawableHitObject)
|
||||||
|
Loading…
Reference in New Issue
Block a user