Skip to content

Commit d01d404

Browse files
committed
Fix regressions regarding multiple remote object selection
1 parent 6b5b84c commit d01d404

File tree

6 files changed

+25
-26
lines changed

6 files changed

+25
-26
lines changed

editor/debugger/editor_debugger_inspector.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ EditorDebuggerRemoteObjects *EditorDebuggerInspector::set_objects(const Array &p
271271
remote_objects->prop_list.clear();
272272
int new_props_added = 0;
273273
HashSet<String> changed;
274-
for (const KeyValue<String, UsageData> &KV : usage) {
274+
for (KeyValue<String, UsageData> &KV : usage) {
275275
const PropertyInfo &pinfo = KV.value.prop.first;
276276
Variant var = KV.value.values[remote_objects->remote_object_ids[0]];
277277

@@ -287,6 +287,7 @@ EditorDebuggerRemoteObjects *EditorDebuggerInspector::set_objects(const Array &p
287287
}
288288
}
289289
var = ResourceLoader::load(path);
290+
KV.value.values[remote_objects->remote_object_ids[0]] = var;
290291

291292
if (pinfo.hint_string == "Script") {
292293
if (remote_objects->get_script() != var) {

editor/debugger/editor_debugger_node.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ ScriptEditorDebugger *EditorDebuggerNode::_add_debugger() {
116116
node->connect("remote_tree_updated", callable_mp(this, &EditorDebuggerNode::_remote_tree_updated).bind(id));
117117
node->connect("remote_objects_updated", callable_mp(this, &EditorDebuggerNode::_remote_objects_updated).bind(id));
118118
node->connect("remote_object_property_updated", callable_mp(this, &EditorDebuggerNode::_remote_object_property_updated).bind(id));
119+
node->connect("remote_objects_requested", callable_mp(this, &EditorDebuggerNode::_remote_objects_requested).bind(id));
119120
node->connect("set_breakpoint", callable_mp(this, &EditorDebuggerNode::_breakpoint_set_in_tree).bind(id));
120121
node->connect("clear_breakpoints", callable_mp(this, &EditorDebuggerNode::_breakpoints_cleared_in_tree).bind(id));
121122
node->connect("errors_cleared", callable_mp(this, &EditorDebuggerNode::_update_errors));
@@ -679,8 +680,6 @@ void EditorDebuggerNode::request_remote_tree() {
679680
}
680681

681682
void EditorDebuggerNode::set_remote_selection(const TypedArray<int64_t> &p_ids) {
682-
remote_scene_tree->select_nodes(p_ids);
683-
684683
stop_waiting_inspection();
685684
get_current_debugger()->request_remote_objects(p_ids);
686685
}

editor/debugger/editor_expression_evaluator.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ void EditorExpressionEvaluator::_clear() {
7474
}
7575

7676
void EditorExpressionEvaluator::_remote_object_selected(ObjectID p_id) {
77-
editor_debugger->emit_signal(SNAME("remote_object_requested"), p_id);
77+
Array arr;
78+
arr.append(p_id);
79+
editor_debugger->emit_signal(SNAME("remote_objects_requested"), arr);
7880
}
7981

8082
void EditorExpressionEvaluator::_on_expression_input_changed(const String &p_expression) {

editor/debugger/script_editor_debugger.cpp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,9 @@ void ScriptEditorDebugger::clear_inspector(bool p_send_msg) {
300300
}
301301

302302
void ScriptEditorDebugger::_remote_object_selected(ObjectID p_id) {
303-
emit_signal(SNAME("remote_object_requested"), p_id);
303+
Array arr;
304+
arr.append(p_id);
305+
emit_signal(SNAME("remote_objects_requested"), arr);
304306
}
305307

306308
void ScriptEditorDebugger::_remote_objects_edited(const String &p_prop, const TypedDictionary<uint64_t, Variant> &p_values, const String &p_field) {
@@ -439,16 +441,10 @@ void ScriptEditorDebugger::_msg_scene_scene_tree(uint64_t p_thread_id, const Arr
439441

440442
void ScriptEditorDebugger::_msg_scene_inspect_objects(uint64_t p_thread_id, const Array &p_data) {
441443
ERR_FAIL_COND(p_data.is_empty());
444+
EditorDebuggerRemoteObjects *objs = inspector->set_objects(p_data);
445+
if (objs && EditorDebuggerNode::get_singleton()->match_remote_selection(objs->remote_object_ids)) {
446+
EditorDebuggerNode::get_singleton()->stop_waiting_inspection();
442447

443-
TypedArray<uint64_t> ids;
444-
for (const Array arr : p_data) {
445-
ERR_FAIL_COND(arr.is_empty());
446-
ERR_FAIL_COND(arr[0].get_type() != Variant::INT);
447-
ids.append(arr[0]);
448-
}
449-
450-
if (EditorDebuggerNode::get_singleton()->match_remote_selection(ids)) {
451-
EditorDebuggerRemoteObjects *objs = inspector->set_objects(p_data);
452448
emit_signal(SNAME("remote_objects_updated"), objs);
453449
}
454450
}
@@ -881,7 +877,7 @@ void ScriptEditorDebugger::_msg_request_quit(uint64_t p_thread_id, const Array &
881877
_stop_and_notify();
882878
}
883879

884-
void ScriptEditorDebugger::_msg_remote_nodes_clicked(uint64_t p_thread_id, const Array &p_data) {
880+
void ScriptEditorDebugger::_msg_remote_objects_selected(uint64_t p_thread_id, const Array &p_data) {
885881
ERR_FAIL_COND(p_data.is_empty());
886882
EditorDebuggerRemoteObjects *objs = inspector->set_objects(p_data);
887883
if (objs) {
@@ -892,7 +888,7 @@ void ScriptEditorDebugger::_msg_remote_nodes_clicked(uint64_t p_thread_id, const
892888
}
893889
}
894890

895-
void ScriptEditorDebugger::_msg_remote_nothing_clicked(uint64_t p_thread_id, const Array &p_data) {
891+
void ScriptEditorDebugger::_msg_remote_nothing_selected(uint64_t p_thread_id, const Array &p_data) {
896892
EditorDebuggerNode::get_singleton()->stop_waiting_inspection();
897893

898894
emit_signal(SNAME("remote_tree_clear_selection_requested"));
@@ -973,8 +969,8 @@ void ScriptEditorDebugger::_init_parse_message_handlers() {
973969
parse_message_handlers["servers:profile_frame"] = &ScriptEditorDebugger::_msg_servers_profile_frame;
974970
parse_message_handlers["servers:profile_total"] = &ScriptEditorDebugger::_msg_servers_profile_total;
975971
parse_message_handlers["request_quit"] = &ScriptEditorDebugger::_msg_request_quit;
976-
parse_message_handlers["remote_nodes_clicked"] = &ScriptEditorDebugger::_msg_remote_nodes_clicked;
977-
parse_message_handlers["remote_nothing_clicked"] = &ScriptEditorDebugger::_msg_remote_nothing_clicked;
972+
parse_message_handlers["remote_objects_selected"] = &ScriptEditorDebugger::_msg_remote_objects_selected;
973+
parse_message_handlers["remote_nothing_selected"] = &ScriptEditorDebugger::_msg_remote_nothing_selected;
978974
parse_message_handlers["remote_selection_invalidated"] = &ScriptEditorDebugger::_msg_remote_selection_invalidated;
979975
parse_message_handlers["show_selection_limit_warning"] = &ScriptEditorDebugger::_msg_show_selection_limit_warning;
980976
parse_message_handlers["performance:profile_names"] = &ScriptEditorDebugger::_msg_performance_profile_names;
@@ -1956,6 +1952,7 @@ void ScriptEditorDebugger::_bind_methods() {
19561952
ADD_SIGNAL(MethodInfo("set_execution", PropertyInfo("script"), PropertyInfo(Variant::INT, "line")));
19571953
ADD_SIGNAL(MethodInfo("clear_execution", PropertyInfo("script")));
19581954
ADD_SIGNAL(MethodInfo("breaked", PropertyInfo(Variant::BOOL, "reallydid"), PropertyInfo(Variant::BOOL, "can_debug"), PropertyInfo(Variant::STRING, "reason"), PropertyInfo(Variant::BOOL, "has_stackdump")));
1955+
ADD_SIGNAL(MethodInfo("remote_objects_requested", PropertyInfo(Variant::ARRAY, "ids")));
19591956
ADD_SIGNAL(MethodInfo("remote_objects_updated", PropertyInfo(Variant::OBJECT, "remote_objects")));
19601957
ADD_SIGNAL(MethodInfo("remote_object_property_updated", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::STRING, "property")));
19611958
ADD_SIGNAL(MethodInfo("remote_window_title_changed", PropertyInfo(Variant::STRING, "title")));

editor/debugger/script_editor_debugger.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ class ScriptEditorDebugger : public MarginContainer {
217217
void _msg_servers_profile_frame(uint64_t p_thread_id, const Array &p_data);
218218
void _msg_servers_profile_total(uint64_t p_thread_id, const Array &p_data);
219219
void _msg_request_quit(uint64_t p_thread_id, const Array &p_data);
220-
void _msg_remote_nodes_clicked(uint64_t p_thread_id, const Array &p_data);
221-
void _msg_remote_nothing_clicked(uint64_t p_thread_id, const Array &p_data);
220+
void _msg_remote_objects_selected(uint64_t p_thread_id, const Array &p_data);
221+
void _msg_remote_nothing_selected(uint64_t p_thread_id, const Array &p_data);
222222
void _msg_remote_selection_invalidated(uint64_t p_thread_id, const Array &p_data);
223223
void _msg_show_selection_limit_warning(uint64_t p_thread_id, const Array &p_data);
224224
void _msg_performance_profile_names(uint64_t p_thread_id, const Array &p_data);

scene/debugger/scene_debugger.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,9 @@ void SceneDebugger::_send_object_ids(const Vector<ObjectID> &p_ids, bool p_updat
407407
arr.append(invalid_selection);
408408
EngineDebugger::get_singleton()->send_message("remote_selection_invalidated", arr);
409409

410-
EngineDebugger::get_singleton()->send_message(objs.is_empty() ? "remote_nothing_clicked" : "remote_nodes_clicked", objs);
410+
EngineDebugger::get_singleton()->send_message(objs.is_empty() ? "remote_nothing_selected" : "remote_objects_selected", objs);
411411
} else {
412-
EngineDebugger::get_singleton()->send_message("scene:inspect_objects", objs);
412+
EngineDebugger::get_singleton()->send_message(p_update_selection ? "remote_objects_selected" : "scene:inspect_objects", objs);
413413
}
414414
}
415415

@@ -1652,7 +1652,7 @@ void RuntimeNodeSelect::_physics_frame() {
16521652
#else
16531653
if (!selected_ci_nodes.is_empty() || !selected_3d_nodes.is_empty()) {
16541654
#endif // _3D_DISABLED
1655-
EngineDebugger::get_singleton()->send_message("remote_nothing_clicked", Array());
1655+
EngineDebugger::get_singleton()->send_message("remote_nothing_selected", Array());
16561656
_clear_selection();
16571657
}
16581658

@@ -1714,7 +1714,7 @@ void RuntimeNodeSelect::_send_ids(const Vector<Node *> &p_picked_nodes, bool p_i
17141714
message.append(arr);
17151715
}
17161716

1717-
EngineDebugger::get_singleton()->send_message("remote_nodes_clicked", message);
1717+
EngineDebugger::get_singleton()->send_message("remote_objects_selected", message);
17181718
_set_selected_nodes(picked_nodes);
17191719

17201720
return;
@@ -1778,7 +1778,7 @@ void RuntimeNodeSelect::_send_ids(const Vector<Node *> &p_picked_nodes, bool p_i
17781778
}
17791779

17801780
if (ids.is_empty()) {
1781-
EngineDebugger::get_singleton()->send_message("remote_nothing_clicked", message);
1781+
EngineDebugger::get_singleton()->send_message("remote_nothing_selected", message);
17821782
} else {
17831783
for (const ObjectID &id : ids) {
17841784
SceneDebuggerObject obj(id);
@@ -1787,7 +1787,7 @@ void RuntimeNodeSelect::_send_ids(const Vector<Node *> &p_picked_nodes, bool p_i
17871787
message.append(arr);
17881788
}
17891789

1790-
EngineDebugger::get_singleton()->send_message("remote_nodes_clicked", message);
1790+
EngineDebugger::get_singleton()->send_message("remote_objects_selected", message);
17911791
}
17921792

17931793
_set_selected_nodes(nodes);

0 commit comments

Comments
 (0)