From c53fd9c7be09d0eac2a000816dc7439cc0f568a7 Mon Sep 17 00:00:00 2001 From: Hendrik Brucker Date: Tue, 10 Sep 2024 19:40:42 +0200 Subject: Implement Autostart Feature for Profiler / Visual Profiler / Network Profiler Co-authored-by: stmSi --- editor/debugger/script_editor_debugger.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'editor/debugger/script_editor_debugger.cpp') diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index 5e96daf69c..b798bdf9c1 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -1012,6 +1012,14 @@ void ScriptEditorDebugger::start(Ref p_peer) { _set_reason_text(TTR("Debug session started."), MESSAGE_SUCCESS); _update_buttons_state(); emit_signal(SNAME("started")); + + if (EditorSettings::get_singleton()->get_project_metadata("debug_options", "autostart_profiler", false)) { + profiler->set_profiling(true); + } + + if (EditorSettings::get_singleton()->get_project_metadata("debug_options", "autostart_visual_profiler", false)) { + visual_profiler->set_profiling(true); + } } void ScriptEditorDebugger::_update_buttons_state() { @@ -1076,10 +1084,10 @@ void ScriptEditorDebugger::stop() { profiler_signature.clear(); profiler->set_enabled(false, false); - profiler->set_pressed(false); + profiler->set_profiling(false); visual_profiler->set_enabled(false); - visual_profiler->set_pressed(false); + visual_profiler->set_profiling(false); inspector->edit(nullptr); _update_buttons_state(); -- cgit v1.2.3