Implement toast notifications in the editor
This commit is contained in:
@ -37,7 +37,7 @@
|
||||
#include "scene/gui/center_container.h"
|
||||
#include "scene/resources/font.h"
|
||||
|
||||
void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, ErrorHandlerType p_type) {
|
||||
void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, bool p_editor_notify, ErrorHandlerType p_type) {
|
||||
EditorLog *self = (EditorLog *)p_self;
|
||||
if (self->current != Thread::get_caller_id()) {
|
||||
return;
|
||||
@ -50,6 +50,10 @@ void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_f
|
||||
err_str = String(p_file) + ":" + itos(p_line) + " - " + String(p_error);
|
||||
}
|
||||
|
||||
if (p_editor_notify) {
|
||||
err_str += " (User)";
|
||||
}
|
||||
|
||||
if (p_type == ERR_HANDLER_WARNING) {
|
||||
self->add_message(err_str, MSG_TYPE_WARNING);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user