|
@@ -385,12 +385,19 @@ Control *EditorToaster::popup(Control *p_control, Severity p_severity, double p_
|
|
}
|
|
}
|
|
|
|
|
|
void EditorToaster::popup_str(String p_message, Severity p_severity, String p_tooltip) {
|
|
void EditorToaster::popup_str(String p_message, Severity p_severity, String p_tooltip) {
|
|
|
|
+ if (is_processing_error) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
// Since "_popup_str" adds nodes to the tree, and since the "add_child" method is not
|
|
// Since "_popup_str" adds nodes to the tree, and since the "add_child" method is not
|
|
// thread-safe, it's better to defer the call to the next cycle to be thread-safe.
|
|
// thread-safe, it's better to defer the call to the next cycle to be thread-safe.
|
|
|
|
+ is_processing_error = true;
|
|
call_deferred(SNAME("_popup_str"), p_message, p_severity, p_tooltip);
|
|
call_deferred(SNAME("_popup_str"), p_message, p_severity, p_tooltip);
|
|
|
|
+ is_processing_error = false;
|
|
}
|
|
}
|
|
|
|
|
|
void EditorToaster::_popup_str(String p_message, Severity p_severity, String p_tooltip) {
|
|
void EditorToaster::_popup_str(String p_message, Severity p_severity, String p_tooltip) {
|
|
|
|
+ is_processing_error = true;
|
|
// Check if we already have a popup with the given message.
|
|
// Check if we already have a popup with the given message.
|
|
Control *control = nullptr;
|
|
Control *control = nullptr;
|
|
for (KeyValue<Control *, Toast> element : toasts) {
|
|
for (KeyValue<Control *, Toast> element : toasts) {
|
|
@@ -432,6 +439,7 @@ void EditorToaster::_popup_str(String p_message, Severity p_severity, String p_t
|
|
} else {
|
|
} else {
|
|
label->set_text(vformat("%s (%d)", p_message, toasts[control].count));
|
|
label->set_text(vformat("%s (%d)", p_message, toasts[control].count));
|
|
}
|
|
}
|
|
|
|
+ is_processing_error = false;
|
|
}
|
|
}
|
|
|
|
|
|
void EditorToaster::close(Control *p_control) {
|
|
void EditorToaster::close(Control *p_control) {
|