From e85c0397223c162720004bcb66c249cfbaf0b1d1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 16 Oct 2023 13:31:14 +0900 Subject: [PATCH] Adjust method flow to hopefully be more legible --- .../Objects/Drawables/DrawableHoldNoteTail.cs | 2 +- .../Objects/Drawables/DrawableNote.cs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTail.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTail.cs index a183231310..79002b3819 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTail.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTail.cs @@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables // Factor in the release 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. bool hasComboBreak = !HoldNote.Head.IsHit || HoldNote.Body.HasHoldBreak; diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index 99bd66a147..c7eabaf616 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -105,11 +105,16 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables if (result == HitResult.None) return; + result = GetCappedResult(result); + bonusNote.TriggerResult(result == HitResult.Perfect); - ApplyResult(r => r.Type = MutateResultApplication(result)); + ApplyResult(r => r.Type = result); } - protected virtual HitResult MutateResultApplication(HitResult result) => result; + /// + /// Some objects in mania may want to limit the max result. + /// + protected virtual HitResult GetCappedResult(HitResult result) => result; public virtual bool OnPressed(KeyBindingPressEvent e) {