diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2020-04-06 14:15:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-06 14:15:20 +0300 |
commit | e0a9879ce473049995d21930179699ac5753edee (patch) | |
tree | 0c2941259ab37734eb0ed46535e42759c76cf307 /editor | |
parent | e14464caebedfd24e5c425d7118981123f8055a5 (diff) | |
parent | 8dfe6716ec7204c110a2977eb22bd74029b32c36 (diff) |
Merge pull request #37623 from Chaosus/vs_fix_keyword_name
Adds warning to the uniform name in visual shader if its equal to keyword
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index b1bd6392d8..294ce2c4cd 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -556,6 +556,17 @@ void VisualShaderEditor::_update_graph() { uniform_name->connect("text_entered", callable_mp(this, &VisualShaderEditor::_line_edit_changed), varray(uniform_name, nodes[n_i])); uniform_name->connect("focus_exited", callable_mp(this, &VisualShaderEditor::_line_edit_focus_out), varray(uniform_name, nodes[n_i])); + String error = vsnode->get_warning(visual_shader->get_mode(), type); + if (error != String()) { + offset = memnew(Control); + offset->set_custom_minimum_size(Size2(0, 4 * EDSCALE)); + node->add_child(offset); + Label *error_label = memnew(Label); + error_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor")); + error_label->set_text(error); + node->add_child(error_label); + } + if (vsnode->get_input_port_count() == 0 && vsnode->get_output_port_count() == 1 && vsnode->get_output_port_name(0) == "") { //shortcut VisualShaderNode::PortType port_right = vsnode->get_output_port_type(0); |