(
ctx: &mut ScriptContext<'_, API>,
name: &str,
text: &str,
)
| 3721 | pub fn file_path_has_tag(path: &str, tag: &str) -> bool { |
| 3722 | let kind = editor_files::kind_label(path); |
| 3723 | let badge = editor_files::display_kind_label(path).to_ascii_lowercase(); |
| 3724 | match tag { |
| 3725 | "dir" | "folder" => path.ends_with('/'), |
| 3726 | "scene" | "scn" => kind == "scene", |
| 3727 | "script" | "rs" => kind == "script", |
| 3728 | "img" | "image" => kind == "image", |
| 3729 | "audio" | "aud" => kind == "audio", |
| 3730 | "mesh" => kind == "mesh", |
| 3731 | "glb" | "gltf" => badge == "glb", |
| 3732 | "anim" | "panim" => path.ends_with(".panim"), |
| 3733 | "mat" | "pmat" => path.ends_with(".pmat"), |
| 3734 | "res" | "resource" => kind == "resource", |
| 3735 | _ => badge.contains(tag) || kind.contains(tag) || path.to_ascii_lowercase().contains(tag), |
| 3736 | } |
| 3737 | } |
| 3738 | |
| 3739 | pub fn file_panel_title(state: &EditorState) -> String { |
| 3740 | if state.activity_mode == "glb" { |
| 3741 | return "GLB Files".to_string(); |
| 3742 | } |
| 3743 | if state.active_asset_path.ends_with('/') { |
| 3744 | format!( |
| 3745 | "FileSystem {}", |
no test coverage detected