summaryrefslogtreecommitdiffstats
path: root/core/print_string.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-11-17 16:05:44 -0300
committerGitHub <noreply@github.com>2017-11-17 16:05:44 -0300
commitebbe2bd57235fcbd2edb82c05bb9d7d768b3e7ca (patch)
tree8525dd572373c91efe33568f3c1a8663c0ed8d1a /core/print_string.cpp
parent0968c8d2f65f7ac6e0d6b3718ee1028b229b3353 (diff)
parentb96ee28acd80230ee56000fad2a3ca15e461d5e2 (diff)
downloadredot-engine-ebbe2bd57235fcbd2edb82c05bb9d7d768b3e7ca.tar.gz
Merge pull request #12930 from vnen/gdscrit-output-print
Make tool scripts print on the editor Output panel
Diffstat (limited to 'core/print_string.cpp')
-rw-r--r--core/print_string.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/core/print_string.cpp b/core/print_string.cpp
index 92a04cbf0b..520fb3daec 100644
--- a/core/print_string.cpp
+++ b/core/print_string.cpp
@@ -82,7 +82,25 @@ void print_line(String p_string) {
PrintHandlerList *l = print_handler_list;
while (l) {
- l->printfunc(l->userdata, p_string);
+ l->printfunc(l->userdata, p_string, false);
+ l = l->next;
+ }
+
+ _global_unlock();
+}
+
+void print_error(String p_string) {
+
+ if (!_print_error_enabled)
+ return;
+
+ OS::get_singleton()->printerr("%s\n", p_string.utf8().get_data());
+
+ _global_lock();
+ PrintHandlerList *l = print_handler_list;
+ while (l) {
+
+ l->printfunc(l->userdata, p_string, true);
l = l->next;
}