classref: Sync with current master branch (f87858a8f)

This commit is contained in:
Yuri Sizov
2022-12-05 20:38:58 +03:00
parent 913ff5e602
commit a7745c4cc4
843 changed files with 158186 additions and 80821 deletions
+82 -27
View File
@@ -14,113 +14,168 @@ ScriptEditor
Godot editor's script editor.
.. rst-class:: classref-introduction-group
Description
-----------
**Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_script_editor<class_EditorInterface_method_get_script_editor>`.
.. rst-class:: classref-reftable-group
Methods
-------
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ScriptEditorBase<class_ScriptEditorBase>` | :ref:`get_current_editor<class_ScriptEditor_method_get_current_editor>` **(** **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Script<class_Script>` | :ref:`get_current_script<class_ScriptEditor_method_get_current_script>` **(** **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ScriptEditorBase[]<class_ScriptEditorBase>` | :ref:`get_open_script_editors<class_ScriptEditor_method_get_open_script_editors>` **(** **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Script[]<class_Script>` | :ref:`get_open_scripts<class_ScriptEditor_method_get_open_scripts>` **(** **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`goto_line<class_ScriptEditor_method_goto_line>` **(** :ref:`int<class_int>` line_number **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`open_script_create_dialog<class_ScriptEditor_method_open_script_create_dialog>` **(** :ref:`String<class_String>` base_name, :ref:`String<class_String>` base_path **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`register_syntax_highlighter<class_ScriptEditor_method_register_syntax_highlighter>` **(** :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` syntax_highlighter **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`unregister_syntax_highlighter<class_ScriptEditor_method_unregister_syntax_highlighter>` **(** :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` syntax_highlighter **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ScriptEditorBase<class_ScriptEditorBase>` | :ref:`get_current_editor<class_ScriptEditor_method_get_current_editor>` **(** **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Script<class_Script>` | :ref:`get_current_script<class_ScriptEditor_method_get_current_script>` **(** **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ScriptEditorBase[]<class_ScriptEditorBase>` | :ref:`get_open_script_editors<class_ScriptEditor_method_get_open_script_editors>` **(** **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Script[]<class_Script>` | :ref:`get_open_scripts<class_ScriptEditor_method_get_open_scripts>` **(** **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`goto_line<class_ScriptEditor_method_goto_line>` **(** :ref:`int<class_int>` line_number **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`open_script_create_dialog<class_ScriptEditor_method_open_script_create_dialog>` **(** :ref:`String<class_String>` base_name, :ref:`String<class_String>` base_path **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`register_syntax_highlighter<class_ScriptEditor_method_register_syntax_highlighter>` **(** :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` syntax_highlighter **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`unregister_syntax_highlighter<class_ScriptEditor_method_unregister_syntax_highlighter>` **(** :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` syntax_highlighter **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_ScriptEditor_signal_editor_script_changed:
- **editor_script_changed** **(** :ref:`Script<class_Script>` script **)**
.. rst-class:: classref-signal
**editor_script_changed** **(** :ref:`Script<class_Script>` script **)**
Emitted when user changed active script. Argument is a freshly activated :ref:`Script<class_Script>`.
.. rst-class:: classref-item-separator
----
.. _class_ScriptEditor_signal_script_close:
- **script_close** **(** :ref:`Script<class_Script>` script **)**
.. rst-class:: classref-signal
**script_close** **(** :ref:`Script<class_Script>` script **)**
Emitted when editor is about to close the active script. Argument is a :ref:`Script<class_Script>` that is going to be closed.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_ScriptEditor_method_get_current_editor:
- :ref:`ScriptEditorBase<class_ScriptEditorBase>` **get_current_editor** **(** **)** |const|
.. rst-class:: classref-method
:ref:`ScriptEditorBase<class_ScriptEditorBase>` **get_current_editor** **(** **)** |const|
Returns the :ref:`ScriptEditorBase<class_ScriptEditorBase>` object that the user is currently editing.
.. rst-class:: classref-item-separator
----
.. _class_ScriptEditor_method_get_current_script:
- :ref:`Script<class_Script>` **get_current_script** **(** **)**
.. rst-class:: classref-method
:ref:`Script<class_Script>` **get_current_script** **(** **)**
Returns a :ref:`Script<class_Script>` that is currently active in editor.
.. rst-class:: classref-item-separator
----
.. _class_ScriptEditor_method_get_open_script_editors:
- :ref:`ScriptEditorBase[]<class_ScriptEditorBase>` **get_open_script_editors** **(** **)** |const|
.. rst-class:: classref-method
:ref:`ScriptEditorBase[]<class_ScriptEditorBase>` **get_open_script_editors** **(** **)** |const|
Returns an array with all :ref:`ScriptEditorBase<class_ScriptEditorBase>` objects which are currently open in editor.
.. rst-class:: classref-item-separator
----
.. _class_ScriptEditor_method_get_open_scripts:
- :ref:`Script[]<class_Script>` **get_open_scripts** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Script[]<class_Script>` **get_open_scripts** **(** **)** |const|
Returns an array with all :ref:`Script<class_Script>` objects which are currently open in editor.
.. rst-class:: classref-item-separator
----
.. _class_ScriptEditor_method_goto_line:
- void **goto_line** **(** :ref:`int<class_int>` line_number **)**
.. rst-class:: classref-method
void **goto_line** **(** :ref:`int<class_int>` line_number **)**
Goes to the specified line in the current script.
.. rst-class:: classref-item-separator
----
.. _class_ScriptEditor_method_open_script_create_dialog:
- void **open_script_create_dialog** **(** :ref:`String<class_String>` base_name, :ref:`String<class_String>` base_path **)**
.. rst-class:: classref-method
void **open_script_create_dialog** **(** :ref:`String<class_String>` base_name, :ref:`String<class_String>` base_path **)**
Opens the script create dialog. The script will extend ``base_name``. The file extension can be omitted from ``base_path``. It will be added based on the selected scripting language.
.. rst-class:: classref-item-separator
----
.. _class_ScriptEditor_method_register_syntax_highlighter:
- void **register_syntax_highlighter** **(** :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` syntax_highlighter **)**
.. rst-class:: classref-method
void **register_syntax_highlighter** **(** :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` syntax_highlighter **)**
Registers the :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` to the editor, the :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` will be available on all open scripts.
\ **Note:** Does not apply to scripts that are already opened.
.. rst-class:: classref-item-separator
----
.. _class_ScriptEditor_method_unregister_syntax_highlighter:
- void **unregister_syntax_highlighter** **(** :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` syntax_highlighter **)**
.. rst-class:: classref-method
void **unregister_syntax_highlighter** **(** :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` syntax_highlighter **)**
Unregisters the :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` from the editor.