Fix continous update of the remote properties
Remove useless debugger property panel Rename Remote Inspector to Live Scene Tree
This commit is contained in:
parent
e59bb87fb6
commit
1473e23df8
@ -3618,8 +3618,10 @@ void PropertyEditor::edit(Object *p_object) {
|
|||||||
|
|
||||||
obj->remove_change_receptor(this);
|
obj->remove_change_receptor(this);
|
||||||
|
|
||||||
if (obj->is_type("ScriptEditorDebuggerInspectedObject"))
|
if (obj->is_type("ScriptEditorDebuggerInspectedObject")) {
|
||||||
set_enable_capitalize_paths(false);
|
set_enable_capitalize_paths(false);
|
||||||
|
emit_signal("object_id_selected", obj->call("get_remote_object_id"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
evaluator->edit(p_object);
|
evaluator->edit(p_object);
|
||||||
|
@ -213,6 +213,7 @@ class PropertyEditor : public Control {
|
|||||||
void _node_removed(Node *p_node);
|
void _node_removed(Node *p_node);
|
||||||
|
|
||||||
friend class ProjectExportDialog;
|
friend class ProjectExportDialog;
|
||||||
|
friend class ScriptEditorDebugger;
|
||||||
void _edit_set(const String &p_name, const Variant &p_value, const String &p_changed_field = "");
|
void _edit_set(const String &p_name, const Variant &p_value, const String &p_changed_field = "");
|
||||||
void _draw_flags(Object *ti, const Rect2 &p_rect);
|
void _draw_flags(Object *ti, const Rect2 &p_rect);
|
||||||
|
|
||||||
|
@ -312,6 +312,9 @@ void ScriptEditorDebugger::_scene_tree_variable_value_edited(const String &p_pro
|
|||||||
|
|
||||||
void ScriptEditorDebugger::_scene_tree_property_select_object(ObjectID p_object) {
|
void ScriptEditorDebugger::_scene_tree_property_select_object(ObjectID p_object) {
|
||||||
|
|
||||||
|
if (p_object == inspected_object_id)
|
||||||
|
return;
|
||||||
|
|
||||||
inspected_object_id = p_object;
|
inspected_object_id = p_object;
|
||||||
Array msg;
|
Array msg;
|
||||||
msg.push_back("inspect_object");
|
msg.push_back("inspect_object");
|
||||||
@ -489,6 +492,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
|
|||||||
debugObj->update_single(pinfo.name.ascii().get_data());
|
debugObj->update_single(pinfo.name.ascii().get_data());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inspected_object_id = id;
|
||||||
debugObj->update();
|
debugObj->update();
|
||||||
editor->push_item(debugObj, "");
|
editor->push_item(debugObj, "");
|
||||||
|
|
||||||
@ -985,33 +989,23 @@ void ScriptEditorDebugger::_notification(int p_what) {
|
|||||||
case NOTIFICATION_PROCESS: {
|
case NOTIFICATION_PROCESS: {
|
||||||
|
|
||||||
if (connection.is_valid()) {
|
if (connection.is_valid()) {
|
||||||
inspect_scene_tree_timeout -= get_process_delta_time();
|
|
||||||
if (inspect_scene_tree_timeout < 0) {
|
|
||||||
inspect_scene_tree_timeout = EditorSettings::get_singleton()->get("debugger/scene_tree_refresh_interval");
|
|
||||||
if (inspect_scene_tree->is_visible()) {
|
|
||||||
_scene_tree_request();
|
|
||||||
|
|
||||||
if (inspected_object_id != 0) {
|
|
||||||
//take the chance and re-inspect selected object
|
|
||||||
Array msg;
|
|
||||||
msg.push_back("inspect_object");
|
|
||||||
msg.push_back(inspected_object_id);
|
|
||||||
ppeer->put_var(msg);
|
|
||||||
inspected_object_id = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inspect_edited_object_timeout -= get_process_delta_time();
|
inspect_edited_object_timeout -= get_process_delta_time();
|
||||||
if (inspect_edited_object_timeout < 0) {
|
if (inspect_edited_object_timeout < 0) {
|
||||||
inspect_edited_object_timeout = EditorSettings::get_singleton()->get("debugger/remote_inspect_refresh_interval");
|
inspect_edited_object_timeout = EditorSettings::get_singleton()->get("debugger/remote_inspect_refresh_interval");
|
||||||
if (inspect_scene_tree->is_visible() && inspected_object_id) {
|
|
||||||
//take the chance and re-inspect selected object
|
if (inspect_scene_tree->is_visible())
|
||||||
|
_scene_tree_request();
|
||||||
|
|
||||||
|
bool need_query_instance = inspected_object_id != 0;
|
||||||
|
need_query_instance = need_query_instance && editor->get_property_editor()->is_visible();
|
||||||
|
need_query_instance = need_query_instance && (editor->get_property_editor()->obj != NULL);
|
||||||
|
need_query_instance = need_query_instance && editor->get_property_editor()->obj->is_type("ScriptEditorDebuggerInspectedObject");
|
||||||
|
need_query_instance = need_query_instance && ((ObjectID)editor->get_property_editor()->obj->call("get_remote_object_id") != 0);
|
||||||
|
if (need_query_instance) {
|
||||||
Array msg;
|
Array msg;
|
||||||
msg.push_back("inspect_object");
|
msg.push_back("inspect_object");
|
||||||
msg.push_back(inspected_object_id);
|
msg.push_back(inspected_object_id);
|
||||||
ppeer->put_var(msg);
|
ppeer->put_var(msg);
|
||||||
inspected_object_id = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1210,7 +1204,6 @@ void ScriptEditorDebugger::stop() {
|
|||||||
le_set->set_disabled(true);
|
le_set->set_disabled(true);
|
||||||
profiler->set_enabled(true);
|
profiler->set_enabled(true);
|
||||||
|
|
||||||
inspect_properties->edit(NULL);
|
|
||||||
inspect_scene_tree->clear();
|
inspect_scene_tree->clear();
|
||||||
|
|
||||||
EditorNode::get_singleton()->get_pause_button()->set_pressed(false);
|
EditorNode::get_singleton()->get_pause_button()->set_pressed(false);
|
||||||
@ -1680,9 +1673,6 @@ void ScriptEditorDebugger::_clear_remote_objects() {
|
|||||||
if (inspector)
|
if (inspector)
|
||||||
inspector->edit(NULL);
|
inspector->edit(NULL);
|
||||||
|
|
||||||
if (inspect_properties)
|
|
||||||
inspect_properties->edit(NULL);
|
|
||||||
|
|
||||||
for (Map<ObjectID, ScriptEditorDebuggerInspectedObject *>::Element *E = remote_objects.front(); E; E = E->next()) {
|
for (Map<ObjectID, ScriptEditorDebuggerInspectedObject *>::Element *E = remote_objects.front(); E; E = E->next()) {
|
||||||
memdelete(E->value());
|
memdelete(E->value());
|
||||||
}
|
}
|
||||||
@ -1817,6 +1807,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
|
|||||||
inspector->set_read_only(true);
|
inspector->set_read_only(true);
|
||||||
inspector->connect("object_id_selected", this, "_scene_tree_property_select_object");
|
inspector->connect("object_id_selected", this, "_scene_tree_property_select_object");
|
||||||
sc->add_child(inspector);
|
sc->add_child(inspector);
|
||||||
|
editor->get_property_editor()->connect("object_id_selected", this, "_scene_tree_property_select_object");
|
||||||
|
|
||||||
server = TCP_Server::create_ref();
|
server = TCP_Server::create_ref();
|
||||||
|
|
||||||
@ -1855,29 +1846,12 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
|
|||||||
|
|
||||||
{ // inquire
|
{ // inquire
|
||||||
|
|
||||||
inspect_info = memnew(HSplitContainer);
|
|
||||||
inspect_info->set_name(TTR("Remote Inspector"));
|
|
||||||
tabs->add_child(inspect_info);
|
|
||||||
|
|
||||||
VBoxContainer *info_left = memnew(VBoxContainer);
|
|
||||||
info_left->set_h_size_flags(SIZE_EXPAND_FILL);
|
|
||||||
inspect_info->add_child(info_left);
|
|
||||||
|
|
||||||
inspect_scene_tree = memnew(Tree);
|
inspect_scene_tree = memnew(Tree);
|
||||||
info_left->add_margin_child(TTR("Live Scene Tree:"), inspect_scene_tree, true);
|
inspect_scene_tree->set_name(TTR("Live Scene Tree"));
|
||||||
inspect_scene_tree->connect("cell_selected", this, "_scene_tree_selected");
|
inspect_scene_tree->connect("cell_selected", this, "_scene_tree_selected");
|
||||||
inspect_scene_tree->connect("item_collapsed", this, "_scene_tree_folded");
|
inspect_scene_tree->connect("item_collapsed", this, "_scene_tree_folded");
|
||||||
|
|
||||||
VBoxContainer *info_right = memnew(VBoxContainer);
|
tabs->add_child(inspect_scene_tree);
|
||||||
info_right->set_h_size_flags(SIZE_EXPAND_FILL);
|
|
||||||
inspect_info->add_child(info_right);
|
|
||||||
|
|
||||||
inspect_properties = memnew(PropertyEditor);
|
|
||||||
//inspect_properties->hide_top_label();
|
|
||||||
inspect_properties->set_show_categories(true);
|
|
||||||
inspect_properties->connect("object_id_selected", this, "_scene_tree_property_select_object");
|
|
||||||
|
|
||||||
info_right->add_margin_child(TTR("Remote Object Properties: "), inspect_properties, true);
|
|
||||||
|
|
||||||
inspect_scene_tree_timeout = EDITOR_DEF("debugger/scene_tree_refresh_interval", 1.0);
|
inspect_scene_tree_timeout = EDITOR_DEF("debugger/scene_tree_refresh_interval", 1.0);
|
||||||
inspect_edited_object_timeout = EDITOR_DEF("debugger/remote_inspect_refresh_interval", 0.2);
|
inspect_edited_object_timeout = EDITOR_DEF("debugger/remote_inspect_refresh_interval", 0.2);
|
||||||
@ -2032,7 +2006,6 @@ ScriptEditorDebugger::~ScriptEditorDebugger() {
|
|||||||
ppeer->set_stream_peer(Ref<StreamPeer>());
|
ppeer->set_stream_peer(Ref<StreamPeer>());
|
||||||
|
|
||||||
inspector = NULL;
|
inspector = NULL;
|
||||||
inspect_properties = NULL;
|
|
||||||
|
|
||||||
server->stop();
|
server->stop();
|
||||||
_clear_remote_objects();
|
_clear_remote_objects();
|
||||||
|
@ -67,8 +67,6 @@ class ScriptEditorDebugger : public Control {
|
|||||||
Button *le_clear;
|
Button *le_clear;
|
||||||
|
|
||||||
Tree *inspect_scene_tree;
|
Tree *inspect_scene_tree;
|
||||||
HSplitContainer *inspect_info;
|
|
||||||
PropertyEditor *inspect_properties;
|
|
||||||
float inspect_scene_tree_timeout;
|
float inspect_scene_tree_timeout;
|
||||||
float inspect_edited_object_timeout;
|
float inspect_edited_object_timeout;
|
||||||
ObjectID inspected_object_id;
|
ObjectID inspected_object_id;
|
||||||
|
Loading…
Reference in New Issue
Block a user