(
ctx: &mut ScriptContext<'_, API>,
scene_path: &str,
)
| 691 | state.scene_paths = scene_paths; |
| 692 | }); |
| 693 | } |
| 694 | |
| 695 | if changed_scenes.is_empty() { |
| 696 | if res_changed { |
| 697 | refresh_all(ctx); |
| 698 | } else { |
| 699 | refresh_status(ctx); |
| 700 | } |
| 701 | return; |
| 702 | } |
| 703 | |
| 704 | let reload = with_state_mut!(ctx.run, EditorState, ctx.id, |state| { |
| 705 | let active = state.open_paths.get(state.active_open).cloned(); |
| 706 | match project_scene_change( |
| 707 | &changed_scenes, |
| 708 | active.as_deref(), |
| 709 | state.dirty, |
| 710 | &state.preview_scene_paths, |
| 711 | &state.dirty_scene_paths, |
| 712 | ) { |
| 713 | ProjectSceneChange::Conflict(paths) => { |
| 714 | state.log = format!("external change pending\n{}", paths.join("\n")); |
| 715 | None |
| 716 | } |
| 717 | ProjectSceneChange::ReloadActive(path) => Some(path), |
| 718 | ProjectSceneChange::ReloadPreview => { |
| 719 | state.log = format!("reload preview deps\n{}", changed_scenes.join("\n")); |
| 720 | Some(String::new()) |
| 721 | } |
| 722 | ProjectSceneChange::Notice => { |
| 723 | state.log = format!("project file change\n{}", changed_scenes.join("\n")); |
| 724 | None |
| 725 | } |
| 726 | } |
| 727 | }) |
| 728 | .flatten(); |
| 729 | |
| 730 | match reload { |
| 731 | Some(path) if path.is_empty() => { |
| 732 | rebuild_preview(ctx); |
| 733 | refresh_all(ctx); |
| 734 | } |
| 735 | Some(path) => { |
| 736 | reload_scene_path(ctx, &path); |
no test coverage detected