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

Method _resources_changed

editor/editor_node.cpp:1159–1192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1157}
1158
1159void EditorNode::_resources_changed(const Vector<String> &p_resources) {
1160 List<Ref<Resource>> changed;
1161
1162 int rc = p_resources.size();
1163 for (int i = 0; i < rc; i++) {
1164 Ref<Resource> res = ResourceCache::get_ref(p_resources.get(i));
1165 if (res.is_null()) {
1166 continue;
1167 }
1168
1169 if (!res->editor_can_reload_from_file()) {
1170 continue;
1171 }
1172 if (!res->get_path().is_resource_file() && !res->get_path().is_absolute_path()) {
1173 continue;
1174 }
1175 if (!FileAccess::exists(res->get_path())) {
1176 continue;
1177 }
1178
1179 if (!res->get_import_path().is_empty()) {
1180 // This is an imported resource, will be reloaded if reimported via the _resources_reimported() callback.
1181 continue;
1182 }
1183
1184 changed.push_back(res);
1185 }
1186
1187 if (changed.size()) {
1188 for (Ref<Resource> &res : changed) {
1189 res->reload_from_file();
1190 }
1191 }
1192}
1193
1194void EditorNode::_fs_changed() {
1195 for (FileDialog *E : file_dialogs) {

Callers

nothing calls this directly

Calls 11

is_resource_fileMethod · 0.80
is_absolute_pathMethod · 0.80
sizeMethod · 0.65
getMethod · 0.45
is_nullMethod · 0.45
get_pathMethod · 0.45
is_emptyMethod · 0.45
get_import_pathMethod · 0.45
push_backMethod · 0.45
reload_from_fileMethod · 0.45

Tested by

no test coverage detected