diff options
Diffstat (limited to 'editor/script_editor_debugger.cpp')
-rw-r--r-- | editor/script_editor_debugger.cpp | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 6ee09012a5..6ba507fb9c 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -434,6 +434,15 @@ int ScriptEditorDebugger::_update_scene_tree(TreeItem *parent, const Array &node } item->set_metadata(0, id); + if (id == inspected_object_id) { + TreeItem *cti = item->get_parent(); + while (cti) { + cti->set_collapsed(false); + cti = cti->get_parent(); + } + item->select(0); + } + // Set current item as collapsed if necessary if (parent) { if (!unfold_cache.has(id)) { @@ -1042,17 +1051,15 @@ void ScriptEditorDebugger::_performance_draw() { which.push_back(i); } - Ref<Font> graph_font = get_font("font", "TextEdit"); - if (which.empty()) { - String text = TTR("Pick one or more items from the list to display the graph."); - - perf_draw->draw_string(graph_font, Point2i(MAX(0, perf_draw->get_size().x - graph_font->get_string_size(text).x), perf_draw->get_size().y + graph_font->get_ascent()) / 2, text, get_color("font_color", "Label"), perf_draw->get_size().x); - + info_message->show(); return; } + info_message->hide(); + Ref<StyleBox> graph_sb = get_stylebox("normal", "TextEdit"); + Ref<Font> graph_font = get_font("font", "TextEdit"); int cols = Math::ceil(Math::sqrt((float)which.size())); int rows = Math::ceil((float)which.size() / cols); @@ -1121,7 +1128,6 @@ void ScriptEditorDebugger::_notification(int p_what) { forward->set_icon(get_icon("Forward", "EditorIcons")); dobreak->set_icon(get_icon("Pause", "EditorIcons")); docontinue->set_icon(get_icon("DebugContinue", "EditorIcons")); - //scene_tree_refresh->set_icon( get_icon("Reload","EditorIcons")); le_set->connect("pressed", this, "_live_edit_set"); le_clear->connect("pressed", this, "_live_edit_clear"); error_tree->connect("item_selected", this, "_error_selected"); @@ -1193,7 +1199,7 @@ void ScriptEditorDebugger::_notification(int p_what) { if (connection.is_null()) break; - EditorNode::get_log()->add_message("** Debug Process Started **"); + EditorNode::get_log()->add_message("--- Debugging process started ---", EditorLog::MSG_TYPE_EDITOR); ppeer->set_stream_peer(connection); @@ -1203,7 +1209,7 @@ void ScriptEditorDebugger::_notification(int p_what) { dobreak->set_disabled(false); tabs->set_current_tab(0); - _set_reason_text(TTR("Child Process Connected"), MESSAGE_SUCCESS); + _set_reason_text(TTR("Child process connected."), MESSAGE_SUCCESS); profiler->clear(); inspect_scene_tree->clear(); @@ -1391,7 +1397,7 @@ void ScriptEditorDebugger::stop() { ppeer->set_stream_peer(Ref<StreamPeer>()); if (connection.is_valid()) { - EditorNode::get_log()->add_message("** Debug Process Stopped **"); + EditorNode::get_log()->add_message("--- Debugging process stopped ---", EditorLog::MSG_TYPE_EDITOR); connection.unref(); reason->set_text(""); @@ -2142,11 +2148,13 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { step = memnew(ToolButton); hbc->add_child(step); step->set_tooltip(TTR("Step Into")); + step->set_shortcut(ED_GET_SHORTCUT("debugger/step_into")); step->connect("pressed", this, "debug_step"); next = memnew(ToolButton); hbc->add_child(next); next->set_tooltip(TTR("Step Over")); + next->set_shortcut(ED_GET_SHORTCUT("debugger/step_over")); next->connect("pressed", this, "debug_next"); hbc->add_child(memnew(VSeparator)); @@ -2154,11 +2162,13 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { dobreak = memnew(ToolButton); hbc->add_child(dobreak); dobreak->set_tooltip(TTR("Break")); + dobreak->set_shortcut(ED_GET_SHORTCUT("debugger/break")); dobreak->connect("pressed", this, "debug_break"); docontinue = memnew(ToolButton); hbc->add_child(docontinue); docontinue->set_tooltip(TTR("Continue")); + docontinue->set_shortcut(ED_GET_SHORTCUT("debugger/continue")); docontinue->connect("pressed", this, "debug_continue"); back = memnew(Button); @@ -2299,11 +2309,14 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { perf_monitors->set_column_title(0, TTR("Monitor")); perf_monitors->set_column_title(1, TTR("Value")); perf_monitors->set_column_titles_visible(true); - hsp->add_child(perf_monitors); perf_monitors->connect("item_edited", this, "_performance_select"); + hsp->add_child(perf_monitors); + perf_draw = memnew(Control); + perf_draw->set_clip_contents(true); perf_draw->connect("draw", this, "_performance_draw"); hsp->add_child(perf_draw); + hsp->set_name(TTR("Monitors")); hsp->set_split_offset(340 * EDSCALE); tabs->add_child(hsp); @@ -2337,6 +2350,14 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { perf_items.push_back(it); perf_max.write[i] = 0; } + + info_message = memnew(Label); + info_message->set_text(TTR("Pick one or more items from the list to display the graph.")); + info_message->set_valign(Label::VALIGN_CENTER); + info_message->set_align(Label::ALIGN_CENTER); + info_message->set_autowrap(true); + info_message->set_anchors_and_margins_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); + perf_draw->add_child(info_message); } { //vmem inspect @@ -2348,7 +2369,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { vmem_hb->add_child(memnew(Label(TTR("Total:") + " "))); vmem_total = memnew(LineEdit); vmem_total->set_editable(false); - vmem_total->set_custom_minimum_size(Size2(100, 1) * EDSCALE); + vmem_total->set_custom_minimum_size(Size2(100, 0) * EDSCALE); vmem_hb->add_child(vmem_total); vmem_refresh = memnew(ToolButton); vmem_hb->add_child(vmem_refresh); |