@@ -121,6 +121,7 @@ ScriptEditorDebugger *EditorDebuggerNode::_add_debugger() {
121121 node->connect (" set_breakpoint" , callable_mp (this , &EditorDebuggerNode::_breakpoint_set_in_tree).bind (id));
122122 node->connect (" clear_breakpoints" , callable_mp (this , &EditorDebuggerNode::_breakpoints_cleared_in_tree).bind (id));
123123 node->connect (" errors_cleared" , callable_mp (this , &EditorDebuggerNode::_update_errors));
124+ node->connect (" run_scene_requested" , callable_mp (this , &EditorDebuggerNode::_run_scene_requested).bind (id));
124125
125126 if (tabs->get_tab_count () > 0 ) {
126127 get_debugger (0 )->clear_style ();
@@ -783,6 +784,24 @@ void EditorDebuggerNode::_save_node_requested(ObjectID p_id, const String &p_fil
783784 get_current_debugger ()->save_node (p_id, p_file);
784785}
785786
787+ void EditorDebuggerNode::_run_scene_requested (const String &p_scene, const Vector<String> &p_args, int p_debugger) {
788+ EditorRunBar *editor_run_bar = EditorRunBar::get_singleton ();
789+ ERR_FAIL_NULL (editor_run_bar);
790+
791+ editor_run_bar->stop_playing ();
792+
793+ // Defer starting the new one, so the old one has a chance to fully stop.
794+ callable_mp (this , &EditorDebuggerNode::_run_scene_internal).call_deferred (editor_run_bar, p_scene, p_args);
795+ }
796+
797+ void EditorDebuggerNode::_run_scene_internal (EditorRunBar *p_editor_run_bar, const String &p_scene, const Vector<String> &p_args) {
798+ if (p_scene.is_empty ()) {
799+ p_editor_run_bar->play_main_scene (false );
800+ } else {
801+ p_editor_run_bar->play_custom_scene (p_scene, p_args);
802+ }
803+ }
804+
786805void EditorDebuggerNode::_breakpoint_set_in_tree (Ref<RefCounted> p_script, int p_line, bool p_enabled, int p_debugger) {
787806 if (p_debugger != tabs->get_current_tab ()) {
788807 return ;
0 commit comments