From 2e29ea0ef4bfcb8c6505ce5d79dacec079d3e6ad Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Thu, 26 Oct 2023 14:11:50 +0200 Subject: [PATCH] Fix replays not being perfect Hack fix for now --- .../Objects/Drawables/DrawableStarSheet.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Rush/Objects/Drawables/DrawableStarSheet.cs b/osu.Game.Rulesets.Rush/Objects/Drawables/DrawableStarSheet.cs index 1ebe8da..ac5d213 100644 --- a/osu.Game.Rulesets.Rush/Objects/Drawables/DrawableStarSheet.cs +++ b/osu.Game.Rulesets.Rush/Objects/Drawables/DrawableStarSheet.cs @@ -172,6 +172,16 @@ protected override void CheckForResult(bool userTriggered, double timeOffset) ApplyResult(r => r.Type = r.Judgement.MaxResult); } + private bool iHandledPressed = false; + + protected override void OnApply() + { + base.OnApply(); + + iHandledPressed = false; + } + + public override bool OnPressed(KeyBindingPressEvent e) { if (!e.Action.IsLaneAction()) @@ -184,13 +194,15 @@ public override bool OnPressed(KeyBindingPressEvent e) return false; UpdateResult(true); - return Head.Judged; + + return iHandledPressed = Head.Judged; } public override void OnReleased(KeyBindingReleaseEvent e) { - // TODO: HACK FIX FOR HOTFIX, NEEDS FURTHER INVESTIGATION - if (!IsInUse) + // This is necessary to ensure that holds don't handle releases before handling the press + // TODO: Get rid when things are fixed osu side. + if (!iHandledPressed) return; if (AllJudged)