feat: add respack export and drag & drag+flick judgment protection - #883
Closed
SeRazon wants to merge 5 commits into
Closed
feat: add respack export and drag & drag+flick judgment protection#883SeRazon wants to merge 5 commits into
SeRazon wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an export feature for non-default resource packs, wiring a new export button into the respack page UI and adding an export icon to the shared icon set.
Changes:
- Add an “export respack” button to the resource pack page (non-default packs only) and export the pack folder as a
.zip. - Add a filename sanitization helper for suggested export filenames.
- Add a new
export.pngicon entry to the globalIconsloader.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| phira/src/page/respack.rs | Adds export button + background zip export task handling for respacks |
| phira/src/icons.rs | Adds export icon texture field and loads export.png |
Suppressed comments (2)
phira/src/page/respack.rs:159
- Initialize the new
pending_export_pathfield so the export target is well-defined before any export dialog callback returns.
info_btn: delete_btn.clone(),
export_btn: delete_btn.clone(),
delete_btn,
export_task: None,
phira/src/page/respack.rs:260
take_export()can return long afterrequest_export(...)(Android/iOS), but this code usesself.items[self.index]at callback time and unwrapspath. If the user switches selection (or the current item haspath == None), this can export the wrong pack or panic. Also, on export failure the partially-created file/URI is never cleaned up (ExportConfig.deleter). Use the storedpending_export_pathfrom click time and calldeleteron errors (similar toLibraryPage).
if let Some(config) = take_export() {
match config {
Ok(config) => {
let path = self.items[self.index].path.clone().unwrap();
let (tx, rx) = mpsc::channel();
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
Author
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.
概述
本 PR 包含两个独立功能:
1. 资源包导出功能
实现内容
compress_folder将资源包目录压缩为 ziprequest_export/resolve_export/take_export机制,支持系统文件选择器/ \ : * ? " < > |→_)按钮位置
导出按钮位于信息按钮左侧,与信息、删除按钮保持相同间距和样式:
改动文件
phira/src/page/respack.rs:导出逻辑、按钮渲染、文件名清理phira/src/icons.rs:注册导出图标assets/export.png:导出图标资源2. Drag/Flick 判定保护
实现内容
参考 关于Phigros判定 中描述的官方判定机制,增加早按保护:
INFINITY,使其不会被选中判定逻辑示意
改动文件
prpr/src/judge.rs:新增PROTECTION_THRESHOLD常量、保护时间预处理、匹配阶段权重调整测试情况
cargo build --release)cargo fmt --all --check通过