diff options
author | George Marques <george@gmarqu.es> | 2018-07-01 13:17:40 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2018-08-10 16:00:47 -0300 |
commit | eb481198218399c9f86e5bfe1879757e1aa9a86e (patch) | |
tree | ff6b93d29e52eafee41d3d03e31d765fe1af2eeb /editor/code_editor.cpp | |
parent | 767fb2fa0ba14ee6afb4eeeaad12e5dee944547b (diff) | |
download | redot-engine-eb481198218399c9f86e5bfe1879757e1aa9a86e.tar.gz |
Added system for GDScript warnings
- Count and panel per script.
- Ability to disable warnings per script using special comments.
- Ability to disable warnings globally using Project Settings.
- Option to treat enabled warnings as errors.
Diffstat (limited to 'editor/code_editor.cpp')
-rw-r--r-- | editor/code_editor.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 4ce8556add..29275947a4 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1246,6 +1246,29 @@ CodeTextEditor::CodeTextEditor() { status_bar->add_child(memnew(Label)); //to keep the height if the other labels are not visible + warning_label = memnew(Label); + status_bar->add_child(warning_label); + warning_label->set_align(Label::ALIGN_RIGHT); + warning_label->set_valign(Label::VALIGN_CENTER); + warning_label->set_v_size_flags(SIZE_FILL); + warning_label->set_default_cursor_shape(CURSOR_POINTING_HAND); + warning_label->set_mouse_filter(MOUSE_FILTER_STOP); + warning_label->set_text(TTR("Warnings:")); + warning_label->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("status_source", "EditorFonts")); + + warning_count_label = memnew(Label); + status_bar->add_child(warning_count_label); + warning_count_label->set_valign(Label::VALIGN_CENTER); + warning_count_label->set_v_size_flags(SIZE_FILL); + warning_count_label->set_autowrap(true); // workaround to prevent resizing the label on each change, do not touch + warning_count_label->set_clip_text(true); // workaround to prevent resizing the label on each change, do not touch + warning_count_label->set_custom_minimum_size(Size2(40, 1) * EDSCALE); + warning_count_label->set_align(Label::ALIGN_RIGHT); + warning_count_label->set_default_cursor_shape(CURSOR_POINTING_HAND); + warning_count_label->set_mouse_filter(MOUSE_FILTER_STOP); + warning_count_label->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("status_source", "EditorFonts")); + warning_count_label->set_text("0"); + Label *zoom_txt = memnew(Label); status_bar->add_child(zoom_txt); zoom_txt->set_align(Label::ALIGN_RIGHT); |