diff options
Diffstat (limited to 'editor/gui')
-rw-r--r-- | editor/gui/editor_toaster.cpp | 8 | ||||
-rw-r--r-- | editor/gui/editor_toaster.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/editor/gui/editor_toaster.cpp b/editor/gui/editor_toaster.cpp index ffea1736a3..ff425ba65e 100644 --- a/editor/gui/editor_toaster.cpp +++ b/editor/gui/editor_toaster.cpp @@ -506,6 +506,14 @@ void EditorToaster::instant_close(Control *p_control) { p_control->set_modulate(Color(1, 1, 1, 0)); } +void EditorToaster::_bind_methods() { + ClassDB::bind_method(D_METHOD("push_toast", "message", "severity", "tooltip"), &EditorToaster::_popup_str, DEFVAL(EditorToaster::SEVERITY_INFO), DEFVAL(String())); + + BIND_ENUM_CONSTANT(SEVERITY_INFO); + BIND_ENUM_CONSTANT(SEVERITY_WARNING); + BIND_ENUM_CONSTANT(SEVERITY_ERROR); +} + EditorToaster *EditorToaster::get_singleton() { return singleton; } diff --git a/editor/gui/editor_toaster.h b/editor/gui/editor_toaster.h index 6fcc2ce3e9..0d0080945e 100644 --- a/editor/gui/editor_toaster.h +++ b/editor/gui/editor_toaster.h @@ -105,6 +105,7 @@ private: void _toast_theme_changed(Control *p_control); protected: + static void _bind_methods(); static EditorToaster *singleton; void _notification(int p_what); |