| 733 | refresh_all(ctx); |
| 734 | } |
| 735 | Some(path) => { |
| 736 | reload_scene_path(ctx, &path); |
| 737 | } |
| 738 | None => { |
| 739 | if res_changed { |
| 740 | refresh_all(ctx); |
| 741 | } else { |
| 742 | refresh_status(ctx); |
| 743 | } |
| 744 | } |
| 745 | } |
| 746 | } |
| 747 | |
| 748 | #[derive(Debug, PartialEq, Eq)] |
| 749 | enum ProjectSceneChange { |
| 750 | Conflict(Vec<String>), |
| 751 | ReloadActive(String), |
| 752 | ReloadPreview, |
| 753 | Notice, |
| 754 | } |
| 755 | |
| 756 | fn project_scene_change( |
| 757 | changed: &[String], |
| 758 | active: Option<&str>, |
| 759 | active_dirty: bool, |
| 760 | preview: &[String], |
| 761 | dirty: &[String], |
| 762 | ) -> ProjectSceneChange { |
| 763 | let conflicts = changed |
| 764 | .iter() |
| 765 | .filter(|path| { |
| 766 | dirty.iter().any(|item| item == *path) |
| 767 | || (active_dirty && active == Some(path.as_str())) |
| 768 | }) |
| 769 | .cloned() |