You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
Fix Resource doesn't update when overwritten in editor
This commit is contained in:
@@ -1585,7 +1585,13 @@ void EditorNode::save_resource_in_path(const Ref<Resource> &p_resource, const St
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
((Resource *)p_resource.ptr())->set_path(path);
|
Ref<Resource> prev_resource = ResourceCache::get_ref(p_path);
|
||||||
|
if (prev_resource.is_null() || prev_resource != p_resource) {
|
||||||
|
p_resource->set_path(path, true);
|
||||||
|
}
|
||||||
|
if (prev_resource.is_valid() && prev_resource != p_resource) {
|
||||||
|
replace_resources_in_scenes({ prev_resource }, { p_resource });
|
||||||
|
}
|
||||||
saving_resources_in_path.erase(p_resource);
|
saving_resources_in_path.erase(p_resource);
|
||||||
|
|
||||||
_resource_saved(p_resource, path);
|
_resource_saved(p_resource, path);
|
||||||
|
|||||||
@@ -525,15 +525,14 @@ void QuickOpenResultContainer::_use_default_candidates() {
|
|||||||
if (history) {
|
if (history) {
|
||||||
candidates.append_array(*history);
|
candidates.append_array(*history);
|
||||||
}
|
}
|
||||||
int count = candidates.size();
|
|
||||||
candidates.resize(MIN(max_total_results, filepaths.size()));
|
candidates.resize(MIN(max_total_results, filepaths.size()));
|
||||||
|
int count = candidates.size();
|
||||||
|
int i = 0;
|
||||||
for (const String &filepath : filepaths) {
|
for (const String &filepath : filepaths) {
|
||||||
if (count >= max_total_results) {
|
if (i >= count) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!history || !history_set.has(filepath)) {
|
_setup_candidate(candidates.write[i++], filepath);
|
||||||
_setup_candidate(candidates.write[count++], filepath);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user