1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-05 19:31:35 +00:00

Merge pull request #98680 from jaydensipe/expose-toast-notification-methods

Expose `get_editor_toaster` method to `EditorInterface`
This commit is contained in:
Thaddeus Crews
2024-11-12 12:13:22 -06:00
7 changed files with 59 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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);