Add a shader warning when the uniform buffer limit is exceeded

This commit is contained in:
Yuri Roubinsky 2021-12-22 10:15:12 +03:00
parent 9221c0f8ad
commit fd9c92d4ab
9 changed files with 107 additions and 115 deletions

View file

@ -293,15 +293,20 @@ void ShaderTextEditor::_update_warning_panel() {
}
warning_count++;
int line = w.get_line();
// First cell.
warnings_panel->push_cell();
warnings_panel->push_meta(w.get_line() - 1);
warnings_panel->push_color(warnings_panel->get_theme_color(SNAME("warning_color"), SNAME("Editor")));
warnings_panel->add_text(TTR("Line") + " " + itos(w.get_line()));
warnings_panel->add_text(" (" + w.get_name() + "):");
if (line != -1) {
warnings_panel->push_meta(line - 1);
warnings_panel->add_text(TTR("Line") + " " + itos(line));
warnings_panel->add_text(" (" + w.get_name() + "):");
warnings_panel->pop(); // Meta goto.
} else {
warnings_panel->add_text(w.get_name() + ":");
}
warnings_panel->pop(); // Color.
warnings_panel->pop(); // Meta goto.
warnings_panel->pop(); // Cell.
// Second cell.