Attention: Here be dragons
This is thelatest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
EditorCommandPalette
Inherits:ConfirmationDialog<AcceptDialog<Window<Viewport<Node<Object
Godot editor's command palette.
Description
Object that holds all the available Commands and their shortcuts text. These Commands can be accessed throughEditor > Command Palette menu.
Command key names use slash delimiters to distinguish sections, for example:"example/command1" thenexample will be the section name.
varcommand_palette=EditorInterface.get_command_palette()# external_command is a function that will be called with the command is executed.varcommand_callable=Callable(self,"external_command").bind(arguments)command_palette.add_command("command","test/command",command_callable)
EditorCommandPalettecommandPalette=EditorInterface.Singleton.GetCommandPalette();// ExternalCommand is a function that will be called with the command is executed.CallablecommandCallable=newCallable(this,MethodName.ExternalCommand);commandPalette.AddCommand("command","test/command",commandCallable)
Note: This class shouldn't be instantiated directly. Instead, access the singleton usingEditorInterface.get_command_palette().
Properties
dialog_hide_on_ok |
|
Methods
add_command(command_name:String, key_name:String, binded_callable:Callable, shortcut_text:String = "None") | |
remove_command(key_name:String) |
Method Descriptions
voidadd_command(command_name:String, key_name:String, binded_callable:Callable, shortcut_text:String = "None")🔗
Adds a custom command to EditorCommandPalette.
command_name:String (Name of theCommand. This is displayed to the user.)key_name:String (Name of the key for a particularCommand. This is used to uniquely identify theCommand.)binded_callable:Callable (Callable of theCommand. This will be executed when theCommand is selected.)shortcut_text:String (Shortcut text of theCommand if available.)
voidremove_command(key_name:String)🔗
Removes the custom command from EditorCommandPalette.
key_name:String (Name of the key for a particularCommand.)