diff options
author | Hendrik Brucker <hendrik.brucker@mail.de> | 2024-09-10 19:40:42 +0200 |
---|---|---|
committer | Hendrik Brucker <hendrik.brucker@mail.de> | 2024-09-10 19:40:42 +0200 |
commit | c53fd9c7be09d0eac2a000816dc7439cc0f568a7 (patch) | |
tree | d9ffffbcd5c7c4b0644767aef19c231c4850309e /editor/debugger/script_editor_debugger.cpp | |
parent | 27552a2f26adcdba579cd804197de3942e8cb0ec (diff) | |
download | redot-engine-c53fd9c7be09d0eac2a000816dc7439cc0f568a7.tar.gz |
Implement Autostart Feature for Profiler / Visual Profiler / Network Profiler
Co-authored-by: stmSi <stm1998sithumyo@gmail.com>
Diffstat (limited to 'editor/debugger/script_editor_debugger.cpp')
-rw-r--r-- | editor/debugger/script_editor_debugger.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
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<RemoteDebuggerPeer> 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(); |