Files
godot-docs-l10n/classes/ru/class_editordock.rst
Rémi Verschelde c3f2364c10 Sync classref with 4.6 branch
Lots of translations invalidated (fuzzied) as we just synced Weblate.
2025-12-19 16:39:51 +01:00

480 lines
22 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:github_url: hide
.. _class_EditorDock:
EditorDock
==========
**Экспериментальное:** This class may be changed or removed in future versions.
**Наследует:** :ref:`MarginContainer<class_MarginContainer>` **<** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
**Наследуется от:** :ref:`FileSystemDock<class_FileSystemDock>`
Dockable container for the editor.
.. rst-class:: classref-introduction-group
Описание
----------------
EditorDock is a :ref:`Container<class_Container>` node that can be docked in one of the editor's dock slots. Docks are added by plugins to provide space for controls related to an :ref:`EditorPlugin<class_EditorPlugin>`. The editor comes with a few built-in docks, such as the Scene dock, FileSystem dock, etc.
You can add a dock by using :ref:`EditorPlugin.add_dock()<class_EditorPlugin_method_add_dock>`. The dock can be customized by changing its properties.
::
@tool
extends EditorPlugin
# Dock reference.
var dock
# Plugin initialization.
func _enter_tree():
dock = EditorDock.new()
dock.title = "My Dock"
dock.dock_icon = preload("./dock_icon.png")
dock.default_slot = EditorPlugin.DOCK_SLOT_RIGHT_UL
var dock_content = preload("./dock_content.tscn").instantiate()
dock.add_child(dock_content)
add_dock(dock)
# Plugin clean-up.
func _exit_tree():
remove_dock(dock)
dock.queue_free()
dock = null
.. rst-class:: classref-introduction-group
Обучающие материалы
--------------------------------------
- :doc:`Making plugins <../tutorials/plugins/editor/making_plugins>`
.. rst-class:: classref-reftable-group
Свойства
----------------
.. table::
:widths: auto
+-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+
| |bitfield|\[:ref:`DockLayout<enum_EditorDock_DockLayout>`\] | :ref:`available_layouts<class_EditorDock_property_available_layouts>` | ``5`` |
+-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+
| :ref:`bool<class_bool>` | :ref:`closable<class_EditorDock_property_closable>` | ``false`` |
+-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+
| :ref:`DockSlot<enum_EditorPlugin_DockSlot>` | :ref:`default_slot<class_EditorDock_property_default_slot>` | ``-1`` |
+-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+
| :ref:`Texture2D<class_Texture2D>` | :ref:`dock_icon<class_EditorDock_property_dock_icon>` | |
+-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+
| :ref:`Shortcut<class_Shortcut>` | :ref:`dock_shortcut<class_EditorDock_property_dock_shortcut>` | |
+-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+
| :ref:`bool<class_bool>` | :ref:`force_show_icon<class_EditorDock_property_force_show_icon>` | ``false`` |
+-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+
| :ref:`bool<class_bool>` | :ref:`global<class_EditorDock_property_global>` | ``true`` |
+-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+
| :ref:`StringName<class_StringName>` | :ref:`icon_name<class_EditorDock_property_icon_name>` | ``&""`` |
+-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+
| :ref:`String<class_String>` | :ref:`layout_key<class_EditorDock_property_layout_key>` | ``""`` |
+-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+
| :ref:`String<class_String>` | :ref:`title<class_EditorDock_property_title>` | ``""`` |
+-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+
| :ref:`Color<class_Color>` | :ref:`title_color<class_EditorDock_property_title_color>` | ``Color(0, 0, 0, 0)`` |
+-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+
| :ref:`bool<class_bool>` | :ref:`transient<class_EditorDock_property_transient>` | ``false`` |
+-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+
.. rst-class:: classref-reftable-group
Методы
------------
.. table::
:widths: auto
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`_load_layout_from_config<class_EditorDock_private_method__load_layout_from_config>`\ (\ config\: :ref:`ConfigFile<class_ConfigFile>`, section\: :ref:`String<class_String>`\ ) |virtual| |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`_save_layout_to_config<class_EditorDock_private_method__save_layout_to_config>`\ (\ config\: :ref:`ConfigFile<class_ConfigFile>`, section\: :ref:`String<class_String>`\ ) |virtual| |const| |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`_update_layout<class_EditorDock_private_method__update_layout>`\ (\ layout\: :ref:`int<class_int>`\ ) |virtual| |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`close<class_EditorDock_method_close>`\ (\ ) |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`make_visible<class_EditorDock_method_make_visible>`\ (\ ) |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`open<class_EditorDock_method_open>`\ (\ ) |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Сигналы
--------------
.. _class_EditorDock_signal_closed:
.. rst-class:: classref-signal
**closed**\ (\ ) :ref:`🔗<class_EditorDock_signal_closed>`
Emitted when the dock is closed with the Close button in the context popup, before it's removed from its parent. See :ref:`closable<class_EditorDock_property_closable>`.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Перечисления
------------------------
.. _enum_EditorDock_DockLayout:
.. rst-class:: classref-enumeration
flags **DockLayout**: :ref:`🔗<enum_EditorDock_DockLayout>`
.. _class_EditorDock_constant_DOCK_LAYOUT_VERTICAL:
.. rst-class:: classref-enumeration-constant
:ref:`DockLayout<enum_EditorDock_DockLayout>` **DOCK_LAYOUT_VERTICAL** = ``1``
Allows placing the dock in the vertical dock slots on either side of the editor.
.. _class_EditorDock_constant_DOCK_LAYOUT_HORIZONTAL:
.. rst-class:: classref-enumeration-constant
:ref:`DockLayout<enum_EditorDock_DockLayout>` **DOCK_LAYOUT_HORIZONTAL** = ``2``
Allows placing the dock in the editor's bottom panel.
.. _class_EditorDock_constant_DOCK_LAYOUT_FLOATING:
.. rst-class:: classref-enumeration-constant
:ref:`DockLayout<enum_EditorDock_DockLayout>` **DOCK_LAYOUT_FLOATING** = ``4``
Allows making the dock floating (opened as a separate window).
.. _class_EditorDock_constant_DOCK_LAYOUT_ALL:
.. rst-class:: classref-enumeration-constant
:ref:`DockLayout<enum_EditorDock_DockLayout>` **DOCK_LAYOUT_ALL** = ``7``
Allows placing the dock in all available slots.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Описания свойств
--------------------------------
.. _class_EditorDock_property_available_layouts:
.. rst-class:: classref-property
|bitfield|\[:ref:`DockLayout<enum_EditorDock_DockLayout>`\] **available_layouts** = ``5`` :ref:`🔗<class_EditorDock_property_available_layouts>`
.. rst-class:: classref-property-setget
- |void| **set_available_layouts**\ (\ value\: |bitfield|\[:ref:`DockLayout<enum_EditorDock_DockLayout>`\]\ )
- |bitfield|\[:ref:`DockLayout<enum_EditorDock_DockLayout>`\] **get_available_layouts**\ (\ )
The available layouts for this dock, as a bitmask. By default, the dock allows vertical and floating layouts.
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_property_closable:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **closable** = ``false`` :ref:`🔗<class_EditorDock_property_closable>`
.. rst-class:: classref-property-setget
- |void| **set_closable**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_closable**\ (\ )
If ``true``, the dock can be closed with the Close button in the context popup. Docks with :ref:`global<class_EditorDock_property_global>` enabled are always closable.
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_property_default_slot:
.. rst-class:: classref-property
:ref:`DockSlot<enum_EditorPlugin_DockSlot>` **default_slot** = ``-1`` :ref:`🔗<class_EditorDock_property_default_slot>`
.. rst-class:: classref-property-setget
- |void| **set_default_slot**\ (\ value\: :ref:`DockSlot<enum_EditorPlugin_DockSlot>`\ )
- :ref:`DockSlot<enum_EditorPlugin_DockSlot>` **get_default_slot**\ (\ )
The default dock slot used when adding the dock with :ref:`EditorPlugin.add_dock()<class_EditorPlugin_method_add_dock>`.
After the dock is added, it can be moved to a different slot and the editor will automatically remember its position between sessions. If you remove and re-add the dock, it will be reset to default.
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_property_dock_icon:
.. rst-class:: classref-property
:ref:`Texture2D<class_Texture2D>` **dock_icon** :ref:`🔗<class_EditorDock_property_dock_icon>`
.. rst-class:: classref-property-setget
- |void| **set_dock_icon**\ (\ value\: :ref:`Texture2D<class_Texture2D>`\ )
- :ref:`Texture2D<class_Texture2D>` **get_dock_icon**\ (\ )
The icon for the dock, as a texture. If specified, it will override :ref:`icon_name<class_EditorDock_property_icon_name>`.
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_property_dock_shortcut:
.. rst-class:: classref-property
:ref:`Shortcut<class_Shortcut>` **dock_shortcut** :ref:`🔗<class_EditorDock_property_dock_shortcut>`
.. rst-class:: classref-property-setget
- |void| **set_dock_shortcut**\ (\ value\: :ref:`Shortcut<class_Shortcut>`\ )
- :ref:`Shortcut<class_Shortcut>` **get_dock_shortcut**\ (\ )
The shortcut used to open the dock.
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_property_force_show_icon:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **force_show_icon** = ``false`` :ref:`🔗<class_EditorDock_property_force_show_icon>`
.. rst-class:: classref-property-setget
- |void| **set_force_show_icon**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **get_force_show_icon**\ (\ )
If ``true``, the dock will always display an icon, regardless of :ref:`EditorSettings.interface/editor/dock_tab_style<class_EditorSettings_property_interface/editor/dock_tab_style>` or :ref:`EditorSettings.interface/editor/bottom_dock_tab_style<class_EditorSettings_property_interface/editor/bottom_dock_tab_style>`.
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_property_global:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **global** = ``true`` :ref:`🔗<class_EditorDock_property_global>`
.. rst-class:: classref-property-setget
- |void| **set_global**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_global**\ (\ )
If ``true``, the dock appears in the **Editor > Editor Docks** menu and can be closed. Non-global docks can still be closed using :ref:`close()<class_EditorDock_method_close>` or when :ref:`closable<class_EditorDock_property_closable>` is ``true``.
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_property_icon_name:
.. rst-class:: classref-property
:ref:`StringName<class_StringName>` **icon_name** = ``&""`` :ref:`🔗<class_EditorDock_property_icon_name>`
.. rst-class:: classref-property-setget
- |void| **set_icon_name**\ (\ value\: :ref:`StringName<class_StringName>`\ )
- :ref:`StringName<class_StringName>` **get_icon_name**\ (\ )
The icon for the dock, as a name from the ``EditorIcons`` theme type in the editor theme. You can find the list of available icons `here <https://godot-editor-icons.github.io/>`__.
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_property_layout_key:
.. rst-class:: classref-property
:ref:`String<class_String>` **layout_key** = ``""`` :ref:`🔗<class_EditorDock_property_layout_key>`
.. rst-class:: classref-property-setget
- |void| **set_layout_key**\ (\ value\: :ref:`String<class_String>`\ )
- :ref:`String<class_String>` **get_layout_key**\ (\ )
The key representing this dock in the editor's layout file. If empty, the dock's displayed name will be used instead.
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_property_title:
.. rst-class:: classref-property
:ref:`String<class_String>` **title** = ``""`` :ref:`🔗<class_EditorDock_property_title>`
.. rst-class:: classref-property-setget
- |void| **set_title**\ (\ value\: :ref:`String<class_String>`\ )
- :ref:`String<class_String>` **get_title**\ (\ )
The title of the dock's tab. If empty, the dock's :ref:`Node.name<class_Node_property_name>` will be used. If the name is auto-generated (contains ``@``), the first child's name will be used instead.
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_property_title_color:
.. rst-class:: classref-property
:ref:`Color<class_Color>` **title_color** = ``Color(0, 0, 0, 0)`` :ref:`🔗<class_EditorDock_property_title_color>`
.. rst-class:: classref-property-setget
- |void| **set_title_color**\ (\ value\: :ref:`Color<class_Color>`\ )
- :ref:`Color<class_Color>` **get_title_color**\ (\ )
The color of the dock tab's title. If its alpha is ``0.0``, the default font color will be used.
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_property_transient:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **transient** = ``false`` :ref:`🔗<class_EditorDock_property_transient>`
.. rst-class:: classref-property-setget
- |void| **set_transient**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_transient**\ (\ )
If ``true``, the dock is not automatically opened or closed when loading an editor layout, only moved. It also can't be opened using a shortcut. This is meant for docks that are opened and closed in specific cases, such as when selecting a :ref:`TileMap<class_TileMap>` or :ref:`AnimationTree<class_AnimationTree>` node.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Описания метода
------------------------------
.. _class_EditorDock_private_method__load_layout_from_config:
.. rst-class:: classref-method
|void| **_load_layout_from_config**\ (\ config\: :ref:`ConfigFile<class_ConfigFile>`, section\: :ref:`String<class_String>`\ ) |virtual| :ref:`🔗<class_EditorDock_private_method__load_layout_from_config>`
Implement this method to handle loading this dock's layout. It's equivalent to :ref:`EditorPlugin._set_window_layout()<class_EditorPlugin_private_method__set_window_layout>`. ``section`` is a unique section based on :ref:`layout_key<class_EditorDock_property_layout_key>`.
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_private_method__save_layout_to_config:
.. rst-class:: classref-method
|void| **_save_layout_to_config**\ (\ config\: :ref:`ConfigFile<class_ConfigFile>`, section\: :ref:`String<class_String>`\ ) |virtual| |const| :ref:`🔗<class_EditorDock_private_method__save_layout_to_config>`
Implement this method to handle saving this dock's layout. It's equivalent to :ref:`EditorPlugin._get_window_layout()<class_EditorPlugin_private_method__get_window_layout>`. ``section`` is a unique section based on :ref:`layout_key<class_EditorDock_property_layout_key>`.
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_private_method__update_layout:
.. rst-class:: classref-method
|void| **_update_layout**\ (\ layout\: :ref:`int<class_int>`\ ) |virtual| :ref:`🔗<class_EditorDock_private_method__update_layout>`
Implement this method to handle the layout switching for this dock. ``layout`` is one of the :ref:`DockLayout<enum_EditorDock_DockLayout>` constants.
::
func _update_layout(layout):
box_container.vertical = (layout == DOCK_LAYOUT_VERTICAL)
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_method_close:
.. rst-class:: classref-method
|void| **close**\ (\ ) :ref:`🔗<class_EditorDock_method_close>`
Closes the dock, making its tab hidden.
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_method_make_visible:
.. rst-class:: classref-method
|void| **make_visible**\ (\ ) :ref:`🔗<class_EditorDock_method_make_visible>`
Focuses the dock's tab (or window if it's floating). If the dock was closed, it will be opened. If it's a bottom dock, makes the bottom panel visible.
.. rst-class:: classref-item-separator
----
.. _class_EditorDock_method_open:
.. rst-class:: classref-method
|void| **open**\ (\ ) :ref:`🔗<class_EditorDock_method_open>`
Opens the dock. It will appear in the last used dock slot. If the dock has no default slot, it will be opened floating.
\ **Note:** This does not focus the dock. If you want to open and focus the dock, use :ref:`make_visible()<class_EditorDock_method_make_visible>`.
.. |virtual| replace:: :abbr:`virtual (Этот метод обычно должен быть переопределен пользователем, чтобы иметь какой-либо эффект.)`
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
.. |const| replace:: :abbr:`const (Этот метод не имеет побочных эффектов. Он не изменяет ни одну из переменных-членов экземпляра.)`
.. |vararg| replace:: :abbr:`vararg (Этот метод принимает любое количество аргументов после описанных здесь.)`
.. |constructor| replace:: :abbr:`constructor (Этот метод используется для создания типа.)`
.. |static| replace:: :abbr:`static (Этот метод не нуждается в вызове экземпляра, поэтому его можно вызвать напрямую, используя имя класса.)`
.. |operator| replace:: :abbr:`operator (Этот метод описывает допустимый оператор для использования с этим типом в качестве левого операнда.)`
.. |bitfield| replace:: :abbr:`BitField (Это значение является целым числом, составленным как битовая маска следующих флагов.)`
.. |void| replace:: :abbr:`void (Нет возвращаемого значения.)`