1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 15:57:24 +08:00

Adjust method flow to hopefully be more legible

This commit is contained in:
Dean Herbert 2023-10-16 13:31:14 +09:00
parent ddbda69751
commit e85c039722
No known key found for this signature in database
2 changed files with 8 additions and 3 deletions

View File

@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
// Factor in the release lenience // Factor in the release lenience
base.CheckForResult(userTriggered, timeOffset / TailNote.RELEASE_WINDOW_LENIENCE); base.CheckForResult(userTriggered, timeOffset / TailNote.RELEASE_WINDOW_LENIENCE);
protected override HitResult MutateResultApplication(HitResult result) protected override HitResult GetCappedResult(HitResult result)
{ {
// If the head wasn't hit or the hold note was broken, cap the max score to Meh. // If the head wasn't hit or the hold note was broken, cap the max score to Meh.
bool hasComboBreak = !HoldNote.Head.IsHit || HoldNote.Body.HasHoldBreak; bool hasComboBreak = !HoldNote.Head.IsHit || HoldNote.Body.HasHoldBreak;

View File

@ -105,11 +105,16 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
if (result == HitResult.None) if (result == HitResult.None)
return; return;
result = GetCappedResult(result);
bonusNote.TriggerResult(result == HitResult.Perfect); bonusNote.TriggerResult(result == HitResult.Perfect);
ApplyResult(r => r.Type = MutateResultApplication(result)); ApplyResult(r => r.Type = result);
} }
protected virtual HitResult MutateResultApplication(HitResult result) => result; /// <summary>
/// Some objects in mania may want to limit the max result.
/// </summary>
protected virtual HitResult GetCappedResult(HitResult result) => result;
public virtual bool OnPressed(KeyBindingPressEvent<ManiaAction> e) public virtual bool OnPressed(KeyBindingPressEvent<ManiaAction> e)
{ {