feat: add drag/flick early tap judgment protection - #887
Open
SeRazon wants to merge 4 commits into
Open
Conversation
When a drag/flick note has passed the judge line but is not yet judged, protect upcoming click/hold notes from being triggered by early taps. This matches official Phigros behavior where tapping early near a yellow or red note prioritizes that note over a later blue note. Protection triggers when: - The drag/flick is on the late side (time < current time) and NotJudged - The click/hold is on the early side (time > current time) - The drag/flick is at least 0.01s closer to the judge line than the click/hold
7 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Judge matching logic to add “early tap” protection for Drag/Flick notes (aligned with Phigros-style judgment behavior), preventing unintended early hits on subsequent Click/Hold notes during closest-note matching.
Changes:
- Added a
PROTECTION_THRESHOLDconstant and protection-time preprocessing for unjudged Drag/Flick notes. - Adjusted closest-note matching weights to de-prioritize protected early-side Click/Hold notes (by setting weight to
INFINITY). - Minor refactor to avoid borrowing
line.notesmutably before filtering Flick in click handling.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
参考官方 Phigros 判定机制,增加 Drag/Flick 早按保护,避免误触后续蓝键。
参考资料:关于Phigros判定
实现内容
INFINITY,使其不会被选中判定逻辑示意
改动文件
prpr/src/judge.rs:新增PROTECTION_THRESHOLD常量、保护时间预处理、匹配阶段权重调整测试情况
cargo fmt --all --check通过