mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
98 lines
3.8 KiB
ReStructuredText
98 lines
3.8 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_EditorToaster:
|
|
|
|
EditorToaster
|
|
=============
|
|
|
|
**繼承:** :ref:`HBoxContainer<class_HBoxContainer>` **<** :ref:`BoxContainer<class_BoxContainer>` **<** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
Manages toast notifications within the editor.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
說明
|
|
----
|
|
|
|
This object manages the functionality and display of toast notifications within the editor, ensuring immediate and informative alerts are presented to the user.
|
|
|
|
\ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_editor_toaster()<class_EditorInterface_method_get_editor_toaster>`.
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
方法
|
|
----
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`push_toast<class_EditorToaster_method_push_toast>`\ (\ message\: :ref:`String<class_String>`, severity\: :ref:`Severity<enum_EditorToaster_Severity>` = 0, tooltip\: :ref:`String<class_String>` = ""\ ) |
|
|
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
列舉
|
|
----
|
|
|
|
.. _enum_EditorToaster_Severity:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **Severity**: :ref:`🔗<enum_EditorToaster_Severity>`
|
|
|
|
.. _class_EditorToaster_constant_SEVERITY_INFO:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`Severity<enum_EditorToaster_Severity>` **SEVERITY_INFO** = ``0``
|
|
|
|
Toast will display with an INFO severity.
|
|
|
|
.. _class_EditorToaster_constant_SEVERITY_WARNING:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`Severity<enum_EditorToaster_Severity>` **SEVERITY_WARNING** = ``1``
|
|
|
|
Toast will display with a WARNING severity and have a corresponding color.
|
|
|
|
.. _class_EditorToaster_constant_SEVERITY_ERROR:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`Severity<enum_EditorToaster_Severity>` **SEVERITY_ERROR** = ``2``
|
|
|
|
Toast will display with an ERROR severity and have a corresponding color.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
方法說明
|
|
--------
|
|
|
|
.. _class_EditorToaster_method_push_toast:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **push_toast**\ (\ message\: :ref:`String<class_String>`, severity\: :ref:`Severity<enum_EditorToaster_Severity>` = 0, tooltip\: :ref:`String<class_String>` = ""\ ) :ref:`🔗<class_EditorToaster_method_push_toast>`
|
|
|
|
Pushes a toast notification to the editor for display.
|
|
|
|
.. |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 (無回傳值。)`
|