| 1826 | } |
| 1827 | |
| 1828 | bool EditorNode::_find_and_save_resource(Ref<Resource> p_res, HashMap<Ref<Resource>, bool> &processed, int32_t flags) { |
| 1829 | if (p_res.is_null()) { |
| 1830 | return false; |
| 1831 | } |
| 1832 | |
| 1833 | if (processed.has(p_res)) { |
| 1834 | return processed[p_res]; |
| 1835 | } |
| 1836 | |
| 1837 | bool changed = p_res->is_edited(); |
| 1838 | p_res->set_edited(false); |
| 1839 | |
| 1840 | bool subchanged = _find_and_save_edited_subresources(p_res.ptr(), processed, flags); |
| 1841 | |
| 1842 | if (p_res->get_path().is_resource_file()) { |
| 1843 | if (changed || subchanged) { |
| 1844 | ResourceSaver::save(p_res, p_res->get_path(), flags); |
| 1845 | } |
| 1846 | processed[p_res] = false; // Because it's a file. |
| 1847 | return false; |
| 1848 | } else { |
| 1849 | processed[p_res] = changed; |
| 1850 | return changed; |
| 1851 | } |
| 1852 | } |
| 1853 | |
| 1854 | bool EditorNode::_find_and_save_edited_subresources(Object *obj, HashMap<Ref<Resource>, bool> &processed, int32_t flags) { |
| 1855 | bool ret_changed = false; |
nothing calls this directly
no test coverage detected