1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Apply some xmldoc and structural changes

This commit is contained in:
Dean Herbert 2023-10-10 16:59:18 +09:00
parent 94192644be
commit 8dc9453d8d
No known key found for this signature in database
2 changed files with 15 additions and 11 deletions

View File

@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
public double? HoldStartTime { get; private set; }
/// <summary>
/// Whether the hold note has been released potentially without having caused a break.
/// Used to decide whether to visually clamp the hold note to the judgement line.
/// </summary>
private double? releaseTime;
@ -322,19 +322,22 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
if (e.Action != Action.Value)
return;
// Make sure a hold was started
if (HoldStartTime == null)
return;
// do not run any of this logic when rewinding, as it inverts order of presses/releases.
if ((Clock as IGameplayClock)?.IsRewinding == true)
return;
Tail.UpdateResult();
Body.TriggerResult(Tail.IsHit);
// When our action is released and we are in the middle of a hold, there's a chance that
// the user has released too early (before the tail).
//
// In such a case, we want to record this against the DrawableHoldNoteBody.
if (HoldStartTime != null)
{
Tail.UpdateResult();
Body.TriggerResult(Tail.IsHit);
endHold();
releaseTime = Time.Current;
endHold();
releaseTime = Time.Current;
}
}
private void endHold()

View File

@ -23,8 +23,9 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
internal void TriggerResult(bool hit)
{
if (!AllJudged)
ApplyResult(r => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult);
if (AllJudged) return;
ApplyResult(r => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult);
}
}
}