Allow to select multiple remote nodes at runtime

This commit is contained in:
Michael Alexsander
2024-11-18 15:44:38 -03:00
parent a77a28c029
commit 5c66129e62
22 changed files with 1441 additions and 527 deletions
+16 -4
View File
@@ -2533,12 +2533,13 @@ void EditorNode::_edit_current(bool p_skip_foreign, bool p_skip_inspector_update
InspectorDock::get_inspector_singleton()->edit(nullptr);
NodeDock::get_singleton()->set_node(nullptr);
InspectorDock::get_singleton()->update(nullptr);
EditorDebuggerNode::get_singleton()->clear_remote_tree_selection();
hide_unused_editors();
return;
}
// Update the use folding setting and state.
bool disable_folding = bool(EDITOR_GET("interface/inspector/disable_folding")) || current_obj->is_class("EditorDebuggerRemoteObject");
bool disable_folding = bool(EDITOR_GET("interface/inspector/disable_folding")) || current_obj->is_class("EditorDebuggerRemoteObjects");
if (InspectorDock::get_inspector_singleton()->is_using_folding() == disable_folding) {
InspectorDock::get_inspector_singleton()->set_use_folding(!disable_folding, false);
}
@@ -2566,6 +2567,7 @@ void EditorNode::_edit_current(bool p_skip_foreign, bool p_skip_inspector_update
SceneTreeDock::get_singleton()->set_selected(nullptr);
NodeDock::get_singleton()->set_node(nullptr);
InspectorDock::get_singleton()->update(nullptr);
EditorDebuggerNode::get_singleton()->clear_remote_tree_selection();
ImportDock::get_singleton()->set_edit_path(current_res->get_path());
}
@@ -2605,6 +2607,7 @@ void EditorNode::_edit_current(bool p_skip_foreign, bool p_skip_inspector_update
SceneTreeDock::get_singleton()->set_selected(nullptr);
InspectorDock::get_singleton()->update(nullptr);
}
EditorDebuggerNode::get_singleton()->clear_remote_tree_selection();
if (get_edited_scene() && !get_edited_scene()->get_scene_file_path().is_empty()) {
String source_scene = get_edited_scene()->get_scene_file_path();
@@ -2613,7 +2616,6 @@ void EditorNode::_edit_current(bool p_skip_foreign, bool p_skip_inspector_update
info_is_warning = true;
}
}
} else {
Node *selected_node = nullptr;
@@ -2639,6 +2641,10 @@ void EditorNode::_edit_current(bool p_skip_foreign, bool p_skip_inspector_update
}
}
if (!current_obj->is_class("EditorDebuggerRemoteObjects")) {
EditorDebuggerNode::get_singleton()->clear_remote_tree_selection();
}
InspectorDock::get_inspector_singleton()->edit(current_obj);
NodeDock::get_singleton()->set_node(nullptr);
SceneTreeDock::get_singleton()->set_selected(selected_node);
@@ -4932,7 +4938,8 @@ Ref<Texture2D> EditorNode::get_object_icon(const Object *p_object, const String
Ref<Script> scr = p_object->get_script();
if (Object::cast_to<EditorDebuggerRemoteObject>(p_object)) {
const EditorDebuggerRemoteObjects *robjs = Object::cast_to<EditorDebuggerRemoteObjects>(p_object);
if (robjs) {
String class_name;
if (scr.is_valid()) {
class_name = scr->get_global_name();
@@ -4942,7 +4949,12 @@ Ref<Texture2D> EditorNode::get_object_icon(const Object *p_object, const String
class_name = scr->get_path();
}
}
return get_class_icon(class_name.is_empty() ? Object::cast_to<EditorDebuggerRemoteObject>(p_object)->type_name : class_name, p_fallback);
if (class_name.is_empty()) {
return get_class_icon(robjs->type_name, p_fallback);
}
return get_class_icon(class_name, p_fallback);
}
if (scr.is_null() && p_object->is_class("Script")) {