Skip to content

Commit

Permalink
added action open_in_file_manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan-1F committed Feb 4, 2025
1 parent 11eae1f commit 64e254f
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions phichain-editor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,4 @@ rand = "0.8.5"
bon = "3.0.1"
indexmap = "2.7.0"
egui-phosphor = "0.5.0"
open = "5.3.2"
2 changes: 2 additions & 0 deletions phichain-editor/lang/en_us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,5 @@ action:
phichain.export_as_official: Export as Official

phichain.create_line: Create Line

phichain.open_in_file_manager: Open Project in File Manager
2 changes: 2 additions & 0 deletions phichain-editor/lang/zh_cn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,5 @@ action:
phichain.export_as_official: 导出为官谱

phichain.create_line: 新建判定线

phichain.open_in_file_manager: 在文件管理器中打开项目
7 changes: 7 additions & 0 deletions phichain-editor/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ impl Plugin for ProjectPlugin {
events.send(UnloadProjectEvent);
},
Some(Hotkey::new(KeyCode::KeyW, vec![Modifier::Control])),
)
.add_action(
"phichain.open_in_file_manager",
|project: Res<Project>| {
let _ = open::that(project.path.0.clone());
},
None,
);
}
}
Expand Down

0 comments on commit 64e254f

Please sign in to comment.