MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _find_and_save_resource

Method _find_and_save_resource

editor/editor_node.cpp:1828–1852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1826}
1827
1828bool 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
1854bool EditorNode::_find_and_save_edited_subresources(Object *obj, HashMap<Ref<Resource>, bool> &processed, int32_t flags) {
1855 bool ret_changed = false;

Callers

nothing calls this directly

Calls 7

is_editedMethod · 0.80
is_resource_fileMethod · 0.80
is_nullMethod · 0.45
hasMethod · 0.45
set_editedMethod · 0.45
ptrMethod · 0.45
get_pathMethod · 0.45

Tested by

no test coverage detected