2020-02-07 02:52:05 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								/*************************************************************************/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*  debugger_editor_plugin.cpp                                           */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*************************************************************************/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                       This file is part of:                           */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                           GODOT ENGINE                                */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                      https://godotengine.org                          */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2022-01-03 21:27:34 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur.                 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md).   */  
						 
					
						
							
								
									
										
										
										
											2020-02-07 02:52:05 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								/*                                                                       */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Permission is hereby granted, free of charge, to any person obtaining */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* a copy of this software and associated documentation files (the       */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* "Software"), to deal in the Software without restriction, including   */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* without limitation the rights to use, copy, modify, merge, publish,   */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* distribute, sublicense, and/or sell copies of the Software, and to    */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* permit persons to whom the Software is furnished to do so, subject to */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* the following conditions:                                             */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                                                                       */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* The above copyright notice and this permission notice shall be        */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* included in all copies or substantial portions of the Software.       */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                                                                       */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*************************************************************************/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "debugger_editor_plugin.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "core/os/keyboard.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "editor/debugger/editor_debugger_node.h" 
  
						 
					
						
							
								
									
										
										
										
											2020-03-16 09:37:43 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "editor/debugger/editor_debugger_server.h" 
  
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "editor/editor_node.h" 
  
						 
					
						
							
								
									
										
										
										
											2021-09-24 00:58:14 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "editor/editor_scale.h" 
  
						 
					
						
							
								
									
										
										
										
											2022-07-31 21:14:15 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "editor/editor_settings.h" 
  
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "editor/fileserver/editor_file_server.h" 
  
						 
					
						
							
								
									
										
										
										
											2022-02-14 14:00:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "editor/plugins/script_editor_plugin.h" 
  
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "scene/gui/menu_button.h" 
  
						 
					
						
							
								
									
										
										
										
											2020-02-07 02:52:05 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-27 10:36:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								DebuggerEditorPlugin : : DebuggerEditorPlugin ( MenuButton  * p_debug_menu )  {  
						 
					
						
							
								
									
										
										
										
											2020-03-16 09:37:43 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									EditorDebuggerServer : : initialize ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-13 16:31:57 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									ED_SHORTCUT ( " debugger/step_into " ,  TTR ( " Step Into " ) ,  Key : : F11 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ED_SHORTCUT ( " debugger/step_over " ,  TTR ( " Step Over " ) ,  Key : : F10 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 02:52:05 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									ED_SHORTCUT ( " debugger/break " ,  TTR ( " Break " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-13 16:31:57 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									ED_SHORTCUT ( " debugger/continue " ,  TTR ( " Continue " ) ,  Key : : F12 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 02:52:05 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									ED_SHORTCUT ( " debugger/keep_debugger_open " ,  TTR ( " Keep Debugger Open " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ED_SHORTCUT ( " debugger/debug_with_external_editor " ,  TTR ( " Debug with External Editor " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-03 14:14:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									// File Server for deploy with remote filesystem.
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									file_server  =  memnew ( EditorFileServer ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 02:52:05 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									EditorDebuggerNode  * debugger  =  memnew ( EditorDebuggerNode ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Button  * db  =  EditorNode : : get_singleton ( ) - > add_bottom_panel_item ( TTR ( " Debugger " ) ,  debugger ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-24 00:58:14 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									// Add separation for the warning/error icon that is displayed later.
 
							 
						 
					
						
							
								
									
										
										
										
											2022-04-14 16:20:28 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									db - > add_theme_constant_override ( " h_separation " ,  6  *  EDSCALE ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 02:52:05 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									debugger - > set_tool_button ( db ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									// Main editor debug menu.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									debug_menu  =  p_debug_menu ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PopupMenu  * p  =  debug_menu - > get_popup ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									p - > set_hide_on_checkable_item_selection ( false ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									p - > add_check_shortcut ( ED_SHORTCUT ( " editor/deploy_with_remote_debug " ,  TTR ( " Deploy with Remote Debug " ) ) ,  RUN_DEPLOY_REMOTE_DEBUG ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-12 01:06:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									p - > set_item_tooltip ( - 1 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-03 14:14:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											TTR ( " When this option is enabled, using one-click deploy will make the executable attempt to connect to this computer's IP so the running project can be debugged. \n This option is intended to be used for remote debugging (typically with a mobile device). \n You don't need to enable it to use the GDScript debugger locally. " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									p - > add_check_shortcut ( ED_SHORTCUT ( " editor/small_deploy_with_network_fs " ,  TTR ( " Small Deploy with Network Filesystem " ) ) ,  RUN_FILE_SERVER ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-12 01:06:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									p - > set_item_tooltip ( - 1 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-03 14:14:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											TTR ( " When this option is enabled, using one-click deploy for Android will only export an executable without the project data. \n The filesystem will be provided from the project by the editor over the network. \n On Android, deploying will use the USB cable for faster performance. This option speeds up testing for projects with large assets. " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									p - > add_separator ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									p - > add_check_shortcut ( ED_SHORTCUT ( " editor/visible_collision_shapes " ,  TTR ( " Visible Collision Shapes " ) ) ,  RUN_DEBUG_COLLISONS ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-12 01:06:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									p - > set_item_tooltip ( - 1 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-03 14:14:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											TTR ( " When this option is enabled, collision shapes and raycast nodes (for 2D and 3D) will be visible in the running project. " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-06-15 23:24:06 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									p - > add_check_shortcut ( ED_SHORTCUT ( " editor/visible_paths " ,  TTR ( " Visible Paths " ) ) ,  RUN_DEBUG_PATHS ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									p - > set_item_tooltip ( - 1 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											TTR ( " When this option is enabled, curve resources used by path nodes will be visible in the running project. " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									p - > add_check_shortcut ( ED_SHORTCUT ( " editor/visible_navigation " ,  TTR ( " Visible Navigation " ) ) ,  RUN_DEBUG_NAVIGATION ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-12 01:06:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									p - > set_item_tooltip ( - 1 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-03 14:14:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											TTR ( " When this option is enabled, navigation meshes and polygons will be visible in the running project. " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									p - > add_separator ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-03 14:14:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									p - > add_check_shortcut ( ED_SHORTCUT ( " editor/sync_scene_changes " ,  TTR ( " Synchronize Scene Changes " ) ) ,  RUN_LIVE_DEBUG ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-12 01:06:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									p - > set_item_tooltip ( - 1 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-03 14:14:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											TTR ( " When this option is enabled, any changes made to the scene in the editor will be replicated in the running project. \n When used remotely on a device, this is more efficient when the network filesystem option is enabled. " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									p - > add_check_shortcut ( ED_SHORTCUT ( " editor/sync_script_changes " ,  TTR ( " Synchronize Script Changes " ) ) ,  RUN_RELOAD_SCRIPTS ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-12 01:06:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									p - > set_item_tooltip ( - 1 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-03 14:14:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											TTR ( " When this option is enabled, any script that is saved will be reloaded in the running project. \n When used remotely on a device, this is more efficient when the network filesystem option is enabled. " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									// Multi-instance, start/stop
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 22:48:04 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									instances_menu  =  memnew ( PopupMenu ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									instances_menu - > set_name ( " run_instances " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									instances_menu - > set_hide_on_checkable_item_selection ( false ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 22:48:04 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									p - > add_child ( instances_menu ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									p - > add_separator ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									p - > add_submenu_item ( TTR ( " Run Multiple Instances " ) ,  " run_instances " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									instances_menu - > add_radio_check_item ( TTR ( " Run 1 Instance " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									instances_menu - > set_item_metadata ( 0 ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									instances_menu - > add_radio_check_item ( TTR ( " Run 2 Instances " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									instances_menu - > set_item_metadata ( 1 ,  2 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									instances_menu - > add_radio_check_item ( TTR ( " Run 3 Instances " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									instances_menu - > set_item_metadata ( 2 ,  3 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									instances_menu - > add_radio_check_item ( TTR ( " Run 4 Instances " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									instances_menu - > set_item_metadata ( 3 ,  4 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									instances_menu - > set_item_checked ( 0 ,  true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									instances_menu - > connect ( " index_pressed " ,  callable_mp ( this ,  & DebuggerEditorPlugin : : _select_run_count ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									p - > connect ( " id_pressed " ,  callable_mp ( this ,  & DebuggerEditorPlugin : : _menu_option ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 02:52:05 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								DebuggerEditorPlugin : : ~ DebuggerEditorPlugin ( )  {  
						 
					
						
							
								
									
										
										
										
											2020-03-16 09:37:43 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									EditorDebuggerServer : : deinitialize ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									memdelete ( file_server ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 22:48:04 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								void  DebuggerEditorPlugin : : _select_run_count ( int  p_index )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  len  =  instances_menu - > get_item_count ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									for  ( int  idx  =  0 ;  idx  <  len ;  idx + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										instances_menu - > set_item_checked ( idx ,  idx  = =  p_index ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EditorSettings : : get_singleton ( ) - > set_project_metadata ( " debug_options " ,  " run_debug_instances " ,  instances_menu - > get_item_metadata ( p_index ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 02:52:05 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								void  DebuggerEditorPlugin : : _menu_option ( int  p_option )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									switch  ( p_option )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  RUN_FILE_SERVER :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											bool  ischecked  =  debug_menu - > get_popup ( ) - > is_item_checked ( debug_menu - > get_popup ( ) - > get_item_index ( RUN_FILE_SERVER ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( ischecked )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												file_server - > stop ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												file_server - > start ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											debug_menu - > get_popup ( ) - > set_item_checked ( debug_menu - > get_popup ( ) - > get_item_index ( RUN_FILE_SERVER ) ,  ! ischecked ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											EditorSettings : : get_singleton ( ) - > set_project_metadata ( " debug_options " ,  " run_file_server " ,  ! ischecked ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-10 03:57:30 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										}  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  RUN_LIVE_DEBUG :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											bool  ischecked  =  debug_menu - > get_popup ( ) - > is_item_checked ( debug_menu - > get_popup ( ) - > get_item_index ( RUN_LIVE_DEBUG ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											debug_menu - > get_popup ( ) - > set_item_checked ( debug_menu - > get_popup ( ) - > get_item_index ( RUN_LIVE_DEBUG ) ,  ! ischecked ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											EditorDebuggerNode : : get_singleton ( ) - > set_live_debugging ( ! ischecked ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											EditorSettings : : get_singleton ( ) - > set_project_metadata ( " debug_options " ,  " run_live_debug " ,  ! ischecked ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  RUN_DEPLOY_REMOTE_DEBUG :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											bool  ischecked  =  debug_menu - > get_popup ( ) - > is_item_checked ( debug_menu - > get_popup ( ) - > get_item_index ( RUN_DEPLOY_REMOTE_DEBUG ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											debug_menu - > get_popup ( ) - > set_item_checked ( debug_menu - > get_popup ( ) - > get_item_index ( RUN_DEPLOY_REMOTE_DEBUG ) ,  ! ischecked ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-10 03:57:30 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											EditorSettings : : get_singleton ( ) - > set_project_metadata ( " debug_options " ,  " run_deploy_remote_debug " ,  ! ischecked ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  RUN_DEBUG_COLLISONS :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											bool  ischecked  =  debug_menu - > get_popup ( ) - > is_item_checked ( debug_menu - > get_popup ( ) - > get_item_index ( RUN_DEBUG_COLLISONS ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											debug_menu - > get_popup ( ) - > set_item_checked ( debug_menu - > get_popup ( ) - > get_item_index ( RUN_DEBUG_COLLISONS ) ,  ! ischecked ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											EditorSettings : : get_singleton ( ) - > set_project_metadata ( " debug_options " ,  " run_debug_collisons " ,  ! ischecked ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-06-15 23:24:06 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										}  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  RUN_DEBUG_PATHS :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											bool  ischecked  =  debug_menu - > get_popup ( ) - > is_item_checked ( debug_menu - > get_popup ( ) - > get_item_index ( RUN_DEBUG_PATHS ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											debug_menu - > get_popup ( ) - > set_item_checked ( debug_menu - > get_popup ( ) - > get_item_index ( RUN_DEBUG_PATHS ) ,  ! ischecked ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											EditorSettings : : get_singleton ( ) - > set_project_metadata ( " debug_options " ,  " run_debug_paths " ,  ! ischecked ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										}  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  RUN_DEBUG_NAVIGATION :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											bool  ischecked  =  debug_menu - > get_popup ( ) - > is_item_checked ( debug_menu - > get_popup ( ) - > get_item_index ( RUN_DEBUG_NAVIGATION ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											debug_menu - > get_popup ( ) - > set_item_checked ( debug_menu - > get_popup ( ) - > get_item_index ( RUN_DEBUG_NAVIGATION ) ,  ! ischecked ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											EditorSettings : : get_singleton ( ) - > set_project_metadata ( " debug_options " ,  " run_debug_navigation " ,  ! ischecked ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  RUN_RELOAD_SCRIPTS :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											bool  ischecked  =  debug_menu - > get_popup ( ) - > is_item_checked ( debug_menu - > get_popup ( ) - > get_item_index ( RUN_RELOAD_SCRIPTS ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											debug_menu - > get_popup ( ) - > set_item_checked ( debug_menu - > get_popup ( ) - > get_item_index ( RUN_RELOAD_SCRIPTS ) ,  ! ischecked ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											ScriptEditor : : get_singleton ( ) - > set_live_auto_reload_running_scripts ( ! ischecked ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											EditorSettings : : get_singleton ( ) - > set_project_metadata ( " debug_options " ,  " run_reload_scripts " ,  ! ischecked ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								void  DebuggerEditorPlugin : : _notification ( int  p_what )  {  
						 
					
						
							
								
									
										
										
										
											2022-02-15 21:44:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									switch  ( p_what )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  NOTIFICATION_READY :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											_update_debug_options ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  break ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								void  DebuggerEditorPlugin : : _update_debug_options ( )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  check_deploy_remote  =  EditorSettings : : get_singleton ( ) - > get_project_metadata ( " debug_options " ,  " run_deploy_remote_debug " ,  false ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  check_file_server  =  EditorSettings : : get_singleton ( ) - > get_project_metadata ( " debug_options " ,  " run_file_server " ,  false ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  check_debug_collisions  =  EditorSettings : : get_singleton ( ) - > get_project_metadata ( " debug_options " ,  " run_debug_collisons " ,  false ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-06-15 23:24:06 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  check_debug_paths  =  EditorSettings : : get_singleton ( ) - > get_project_metadata ( " debug_options " ,  " run_debug_paths " ,  false ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  check_debug_navigation  =  EditorSettings : : get_singleton ( ) - > get_project_metadata ( " debug_options " ,  " run_debug_navigation " ,  false ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-29 22:11:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  check_live_debug  =  EditorSettings : : get_singleton ( ) - > get_project_metadata ( " debug_options " ,  " run_live_debug " ,  true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  check_reload_scripts  =  EditorSettings : : get_singleton ( ) - > get_project_metadata ( " debug_options " ,  " run_reload_scripts " ,  true ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  instances  =  EditorSettings : : get_singleton ( ) - > get_project_metadata ( " debug_options " ,  " run_debug_instances " ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( check_deploy_remote )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-10 12:56:01 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										_menu_option ( RUN_DEPLOY_REMOTE_DEBUG ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( check_file_server )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-10 12:56:01 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										_menu_option ( RUN_FILE_SERVER ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( check_debug_collisions )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-10 12:56:01 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										_menu_option ( RUN_DEBUG_COLLISONS ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2022-06-15 23:24:06 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( check_debug_paths )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										_menu_option ( RUN_DEBUG_PATHS ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( check_debug_navigation )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-10 12:56:01 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										_menu_option ( RUN_DEBUG_NAVIGATION ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( check_live_debug )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-10 12:56:01 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										_menu_option ( RUN_LIVE_DEBUG ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( check_reload_scripts )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-10 12:56:01 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										_menu_option ( RUN_RELOAD_SCRIPTS ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 22:48:04 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  len  =  instances_menu - > get_item_count ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									for  ( int  idx  =  0 ;  idx  <  len ;  idx + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										bool  checked  =  ( int ) instances_menu - > get_item_metadata ( idx )  = =  instances ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										instances_menu - > set_item_checked ( idx ,  checked ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-08 18:58:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}