2021-05-29 18:58:16 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								<?xml version="1.0" encoding="UTF-8" ?> 
							 
						 
					
						
							
								
									
										
										
										
											2023-07-06 10:08:05 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								<class  name= "EditorCommandPalette"  inherits= "ConfirmationDialog"  xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"  xsi:noNamespaceSchemaLocation= "../class.xsd" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-29 18:58:16 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									<brief_description > 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-13 14:34:01 +05:30 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										Godot editor's command palette.
							 
						 
					
						
							
								
									
										
										
										
											2021-05-29 18:58:16 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									</brief_description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									<description > 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-13 14:34:01 +05:30 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										Object that holds all the available Commands and their shortcuts text. These Commands can be accessed through [b]Editor >  Command Palette[/b] menu.
							 
						 
					
						
							
								
									
										
										
										
											2022-11-01 15:29:38 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										Command key names use slash delimiters to distinguish sections, for example: [code]"example/command1"[/code] then [code]example[/code] will be the section name.
							 
						 
					
						
							
								
									
										
										
										
											2021-08-13 14:34:01 +05:30 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										[codeblocks]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										[gdscript]
							 
						 
					
						
							
								
									
										
										
										
											2023-08-09 14:03:27 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var command_palette = EditorInterface.get_command_palette()
							 
						 
					
						
							
								
									
										
										
										
											2021-08-13 14:34:01 +05:30 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										# external_command is a function that will be called with the command is executed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										var command_callable = Callable(self, "external_command").bind(arguments)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										command_palette.add_command("command", "test/command",command_callable)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										[/gdscript]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										[csharp]
							 
						 
					
						
							
								
									
										
										
										
											2023-08-09 14:03:27 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										EditorCommandPalette commandPalette = EditorInterface.Singleton.GetCommandPalette();
							 
						 
					
						
							
								
									
										
										
										
											2021-08-13 14:34:01 +05:30 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										// ExternalCommand is a function that will be called with the command is executed.
							 
						 
					
						
							
								
									
										
										
										
											2022-08-26 16:21:45 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										Callable commandCallable = new Callable(this, MethodName.ExternalCommand);
							 
						 
					
						
							
								
									
										
										
										
											2021-08-13 14:34:01 +05:30 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										commandPalette.AddCommand("command", "test/command", commandCallable)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										[/csharp]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										[/codeblocks]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										[b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_command_palette].
							 
						 
					
						
							
								
									
										
										
										
											2021-05-29 18:58:16 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									<tutorials > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									</tutorials> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									<methods > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										<method  name= "add_command" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											<return  type= "void"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 21:11:48 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											<param  index= "0"  name= "command_name"  type= "String"  /> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											<param  index= "1"  name= "key_name"  type= "String"  /> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											<param  index= "2"  name= "binded_callable"  type= "Callable"  /> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											<param  index= "3"  name= "shortcut_text"  type= "String"  default= ""None""  /> 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-29 18:58:16 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-13 14:34:01 +05:30 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												Adds a custom command to EditorCommandPalette.
							 
						 
					
						
							
								
									
										
										
										
											2022-08-12 12:07:53 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												- [param command_name]: [String] (Name of the [b]Command[/b]. This is displayed to the user.)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												- [param key_name]: [String] (Name of the key for a particular [b]Command[/b]. This is used to uniquely identify the [b]Command[/b].)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												- [param binded_callable]: [Callable] (Callable of the [b]Command[/b]. This will be executed when the [b]Command[/b] is selected.)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												- [param shortcut_text]: [String] (Shortcut text of the [b]Command[/b] if available.)
							 
						 
					
						
							
								
									
										
										
										
											2021-05-29 18:58:16 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										</method> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										<method  name= "remove_command" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											<return  type= "void"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 21:11:48 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											<param  index= "0"  name= "key_name"  type= "String"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-29 18:58:16 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-13 14:34:01 +05:30 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												Removes the custom command from EditorCommandPalette.
							 
						 
					
						
							
								
									
										
										
										
											2022-08-12 12:07:53 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												- [param key_name]: [String] (Name of the key for a particular [b]Command[/b].)
							 
						 
					
						
							
								
									
										
										
										
											2021-05-29 18:58:16 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										</method> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									</methods> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									<members > 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-02 22:38:49 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										<member  name= "dialog_hide_on_ok"  type= "bool"  setter= "set_hide_on_ok"  getter= "get_hide_on_ok"  overrides= "AcceptDialog"  default= "false"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-29 18:58:16 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									</members> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								</class>