MCPcopy Create free account
hub / github.com/PerroEngine/Perro / kind_label

Function kind_label

perro_editor/res/scripts/assets/editor_files.rs:32–49  ·  view source on GitHub ↗
(path: &str)

Source from the content-addressed store, hash-verified

30}
31
32pub fn kind_label(path: &str) -> &'static str {
33 if path.ends_with('/') {
34 return "folder";
35 }
36 let Some(ext) = Path::new(path).extension().and_then(|v| v.to_str()) else {
37 return "other";
38 };
39 match ext.to_ascii_lowercase().as_str() {
40 "scn" | "fur" => "scene",
41 "rs" => "script",
42 "png" | "jpg" | "jpeg" | "webp" | "bmp" | "tga" => "image",
43 "wav" | "ogg" | "mp3" | "flac" | "aac" | "m4a" | "mid" | "midi" | "sf2" => "audio",
44 "pmat" | "uistyle" | "ppart" | "ptileset" | "panim" | "panimtree" | "pskel2d"
45 | "pskel3d" => "resource",
46 "glb" | "gltf" | "obj" | "fbx" => "mesh",
47 _ => "other",
48 }
49}
50
51pub fn display_kind_label(path: &str) -> &'static str {
52 if path.ends_with('/') {

Callers 6

asset_node_templateFunction · 0.85
asset_kind_for_pathFunction · 0.85
apply_asset_actionsMethod · 0.85
asset_inspector_textFunction · 0.85
file_iconFunction · 0.85
file_path_has_tagFunction · 0.85

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected