diff options
author | geequlim <geequlim@gmail.com> | 2017-11-22 21:50:54 +0800 |
---|---|---|
committer | geequlim <geequlim@gmail.com> | 2017-11-22 21:53:01 +0800 |
commit | 2f5defab0e90312a916642a5c90fda9464c5eb04 (patch) | |
tree | 0d22e0686c6427d5700711fa54e4bdfd674d95ce /editor | |
parent | 9638c9cb5d5b43a19df390fa0bf6e996e84903bc (diff) |
Add editor setting to allow keep show local scene tree while debugger start.
Rename editor setting scene_tree_refresh_interval to remote_scene_tree_refresh_interval.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/scene_tree_dock.cpp | 12 | ||||
-rw-r--r-- | editor/scene_tree_dock.h | 2 | ||||
-rw-r--r-- | editor/script_editor_debugger.cpp | 13 | ||||
-rw-r--r-- | editor/script_editor_debugger.h | 1 |
4 files changed, 23 insertions, 5 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index a97a5630e6..ca3f13b07d 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -1827,16 +1827,24 @@ void SceneTreeDock::add_remote_tree_editor(Control *p_remote) { void SceneTreeDock::show_remote_tree() { - button_hb->show(); _remote_tree_selected(); } void SceneTreeDock::hide_remote_tree() { - button_hb->hide(); _local_tree_selected(); } +void SceneTreeDock::show_tab_buttons() { + + button_hb->show(); +} + +void SceneTreeDock::hide_tab_buttons() { + + button_hb->hide(); +} + void SceneTreeDock::_remote_tree_selected() { scene_tree->hide(); diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h index 7848052241..41d5bda180 100644 --- a/editor/scene_tree_dock.h +++ b/editor/scene_tree_dock.h @@ -202,6 +202,8 @@ public: void add_remote_tree_editor(Control *p_remote); void show_remote_tree(); void hide_remote_tree(); + void show_tab_buttons(); + void hide_tab_buttons(); void open_script_dialog(Node *p_for_node); SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSelection *p_editor_selection, EditorData &p_editor_data); diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index ef082f29c3..8974bda926 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -957,7 +957,7 @@ void ScriptEditorDebugger::_notification(int p_what) { 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"); + inspect_scene_tree_timeout = EditorSettings::get_singleton()->get("debugger/remote_scene_tree_refresh_interval"); if (inspect_scene_tree->is_visible_in_tree()) { _scene_tree_request(); @@ -1160,7 +1160,12 @@ void ScriptEditorDebugger::start() { return; } - EditorNode::get_singleton()->get_scene_tree_dock()->show_remote_tree(); + EditorNode::get_singleton()->get_scene_tree_dock()->show_tab_buttons(); + auto_switch_remote_scene_tree = (bool)EditorSettings::get_singleton()->get("debugger/auto_switch_to_remote_scene_tree"); + if (auto_switch_remote_scene_tree) { + EditorNode::get_singleton()->get_scene_tree_dock()->show_remote_tree(); + } + set_process(true); } @@ -1198,6 +1203,7 @@ void ScriptEditorDebugger::stop() { EditorNode::get_singleton()->get_pause_button()->set_pressed(false); EditorNode::get_singleton()->get_pause_button()->set_disabled(true); EditorNode::get_singleton()->get_scene_tree_dock()->hide_remote_tree(); + EditorNode::get_singleton()->get_scene_tree_dock()->hide_tab_buttons(); if (hide_on_stop) { if (is_visible_in_tree()) @@ -1848,7 +1854,8 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { inspect_scene_tree->connect("cell_selected", this, "_scene_tree_selected"); inspect_scene_tree->connect("item_collapsed", this, "_scene_tree_folded"); - inspect_scene_tree_timeout = EDITOR_DEF("debugger/scene_tree_refresh_interval", 1.0); + auto_switch_remote_scene_tree = EDITOR_DEF("debugger/auto_switch_to_remote_scene_tree", true); + inspect_scene_tree_timeout = EDITOR_DEF("debugger/remote_scene_tree_refresh_interval", 1.0); inspect_edited_object_timeout = EDITOR_DEF("debugger/remote_inspect_refresh_interval", 0.2); inspected_object_id = 0; updating_scene_tree = false; diff --git a/editor/script_editor_debugger.h b/editor/script_editor_debugger.h index dc851dd575..82dcba469c 100644 --- a/editor/script_editor_debugger.h +++ b/editor/script_editor_debugger.h @@ -75,6 +75,7 @@ class ScriptEditorDebugger : public Control { bool updating_scene_tree; float inspect_scene_tree_timeout; float inspect_edited_object_timeout; + bool auto_switch_remote_scene_tree; ObjectID inspected_object_id; ScriptEditorDebuggerVariables *variables; Map<ObjectID, ScriptEditorDebuggerInspectedObject *> remote_objects; |