aboutsummaryrefslogtreecommitdiff
path: root/editor/script_editor_debugger.cpp
diff options
context:
space:
mode:
authorPaul Joannon2018-02-24 16:59:18 +0100
committerHein-Pieter van Braam2018-02-26 23:55:27 +0100
commit039fc750d5f7cdfe92eb639400ecf488931f1d72 (patch)
tree13a428868f1a127e1510f31cf58ffeba1f26b53a /editor/script_editor_debugger.cpp
parent58a7d78c2272169b9ba4568c60290940ab36b4a0 (diff)
downloadgodot-039fc750d5f7cdfe92eb639400ecf488931f1d72.tar.gz
godot-039fc750d5f7cdfe92eb639400ecf488931f1d72.tar.zst
godot-039fc750d5f7cdfe92eb639400ecf488931f1d72.zip
only show information we have in stacktrace
do not show line number and/or file if not defined (cherry picked from commit 3ee4ce51a9d564584b7878c125085e57faa32f98)
Diffstat (limited to '')
-rw-r--r--editor/script_editor_debugger.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index f69fbc843..09cdb4ccc 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -1638,12 +1638,20 @@ void ScriptEditorDebugger::_error_selected(int p_idx) {
md.push_back(st[i + 1]);
md.push_back(st[i + 2]);
- String str = func + " in " + script.get_file() + ":line " + itos(line);
+ String str = func;
+ String tooltip_str = TTR("Function:") + " " + func;
+ if (script.length() > 0) {
+ str += " in " + script.get_file();
+ tooltip_str = TTR("File:") + " " + script + "\n" + tooltip_str;
+ if (line > 0) {
+ str += ":line " + itos(line);
+ tooltip_str += "\n" + TTR("Line:") + " " + itos(line);
+ }
+ }
error_stack->add_item(str);
error_stack->set_item_metadata(error_stack->get_item_count() - 1, md);
- error_stack->set_item_tooltip(error_stack->get_item_count() - 1,
- TTR("File:") + " " + script + "\n" + TTR("Function:") + " " + func + "\n" + TTR("Line:") + " " + itos(line));
+ error_stack->set_item_tooltip(error_stack->get_item_count() - 1, tooltip_str);
}
}