You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
Merge pull request #60500 from KoBeWi/scene_crasher
This commit is contained in:
@@ -2975,10 +2975,16 @@ void EditorPropertyResource::_set_read_only(bool p_read_only) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void EditorPropertyResource::_resource_selected(const RES &p_resource, bool p_edit) {
|
void EditorPropertyResource::_resource_selected(const RES &p_resource, bool p_edit) {
|
||||||
if (p_resource->is_built_in() && !p_resource->get_path().is_empty() && p_resource->get_path().get_slice("::", 0) != EditorNode::get_singleton()->get_edited_scene()->get_scene_file_path()) {
|
if (p_resource->is_built_in() && !p_resource->get_path().is_empty()) {
|
||||||
// If the resource belongs to another scene, edit it in that scene instead.
|
String parent = p_resource->get_path().get_slice("::", 0);
|
||||||
EditorNode::get_singleton()->call_deferred("edit_foreign_resource", p_resource);
|
List<String> extensions;
|
||||||
return;
|
ResourceLoader::get_recognized_extensions_for_type("PackedScene", &extensions);
|
||||||
|
|
||||||
|
if (extensions.find(parent.get_extension()) && (!EditorNode::get_singleton()->get_edited_scene() || EditorNode::get_singleton()->get_edited_scene()->get_scene_file_path() == parent)) {
|
||||||
|
// If the resource belongs to another scene, edit it in that scene instead.
|
||||||
|
EditorNode::get_singleton()->call_deferred("edit_foreign_resource", p_resource);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!p_edit && use_sub_inspector) {
|
if (!p_edit && use_sub_inspector) {
|
||||||
|
|||||||
Reference in New Issue
Block a user