(source: &Path, target: &Path)
| 1122 | }; |
| 1123 | match result { |
| 1124 | Ok(()) => { |
| 1125 | let _ = with_state_mut!(ctx.run, EditorState, ctx.id, |state| { |
| 1126 | if let Ok(paths) = scan_res_paths(Path::new(&state.project_root)) { |
| 1127 | state.file_paths = paths; |
| 1128 | } |
| 1129 | state.sidebar_mode = "files".to_string(); |
| 1130 | state.activity_mode = "scene".to_string(); |
| 1131 | state.active_asset_path = target.clone(); |
| 1132 | state.file_scope = parent_res_folder(&target); |
| 1133 | reveal_file_path_in_tree(state, &target); |
| 1134 | state.log = format!("dup asset\n{target}"); |
| 1135 | }); |
| 1136 | refresh_all(ctx); |
| 1137 | } |
| 1138 | Err(err) => set_log(ctx, &format!("dup asset fail\n{source}\n{err}")), |
| 1139 | } |
| 1140 | } |
| 1141 | |
| 1142 | pub fn copy_active_asset_path<API: ScriptAPI + ?Sized>(ctx: &mut ScriptContext<'_, API>) { |
no test coverage detected