:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/EditorCommandPalette.xml. .. _class_EditorCommandPalette: EditorCommandPalette ==================== **Inherits:** :ref:`ConfirmationDialog` **<** :ref:`AcceptDialog` **<** :ref:`Window` **<** :ref:`Viewport` **<** :ref:`Node` **<** :ref:`Object` Godot editor's command palette. .. rst-class:: classref-introduction-group Description ----------- Object that holds all the available Commands and their shortcuts text. These Commands can be accessed through **Editor > Command Palette** menu. Command key names use slash delimiters to distinguish sections, for example: ``"example/command1"`` then ``example`` will be the section name. .. tabs:: .. code-tab:: gdscript var command_palette = EditorInterface.get_command_palette() # 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) .. code-tab:: csharp EditorCommandPalette commandPalette = EditorInterface.Singleton.GetCommandPalette(); // ExternalCommand is a function that will be called with the command is executed. Callable commandCallable = new Callable(this, MethodName.ExternalCommand); commandPalette.AddCommand("command", "test/command", commandCallable) \ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_command_palette`. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------+-------------------+------------------------------------------------------------------------------------------+ | :ref:`bool` | dialog_hide_on_ok | ``false`` (overrides :ref:`AcceptDialog`) | +-------------------------+-------------------+------------------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`add_command`\ (\ command_name\: :ref:`String`, key_name\: :ref:`String`, binded_callable\: :ref:`Callable`, shortcut_text\: :ref:`String` = "None"\ ) | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`remove_command`\ (\ key_name\: :ref:`String`\ ) | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_EditorCommandPalette_method_add_command: .. rst-class:: classref-method |void| **add_command**\ (\ command_name\: :ref:`String`, key_name\: :ref:`String`, binded_callable\: :ref:`Callable`, shortcut_text\: :ref:`String` = "None"\ ) :ref:`🔗` Adds a custom command to EditorCommandPalette. - ``command_name``: :ref:`String` (Name of the **Command**. This is displayed to the user.) - ``key_name``: :ref:`String` (Name of the key for a particular **Command**. This is used to uniquely identify the **Command**.) - ``binded_callable``: :ref:`Callable` (Callable of the **Command**. This will be executed when the **Command** is selected.) - ``shortcut_text``: :ref:`String` (Shortcut text of the **Command** if available.) .. rst-class:: classref-item-separator ---- .. _class_EditorCommandPalette_method_remove_command: .. rst-class:: classref-method |void| **remove_command**\ (\ key_name\: :ref:`String`\ ) :ref:`🔗` Removes the custom command from EditorCommandPalette. - ``key_name``: :ref:`String` (Name of the key for a particular **Command**.) .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`