diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-23 00:27:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-23 00:27:48 +0100 |
commit | ee253163abb04e20cf64891e1a75c1d3834b26d7 (patch) | |
tree | ef302fb15a5ccae187f3250c297d3dfe5499b777 /editor/plugins | |
parent | e1706be25dae883aeba7e1971f2a9c7bcd23ca6e (diff) | |
parent | 538cff13519c868e82ecca7ad9f39c17ee6abfac (diff) |
Merge pull request #57056 from Chaosus/vs_fix_defaults
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 9de811e584..c4fda0231c 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -351,6 +351,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) { if (!graph_plugin) { return; } + Shader::Mode mode = visual_shader->get_mode(); Control *offset; @@ -707,9 +708,9 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) { label->add_theme_style_override("normal", label_style); //more compact hb->add_child(label); - if (vsnode->get_input_port_default_hint(i) != "" && !port_left_used) { + if (vsnode->is_input_port_default(i, mode) && !port_left_used) { Label *hint_label = memnew(Label); - hint_label->set_text("[" + vsnode->get_input_port_default_hint(i) + "]"); + hint_label->set_text(TTR("[default]")); hint_label->add_theme_color_override("font_color", editor->get_theme_color(SNAME("font_readonly_color"), SNAME("TextEdit"))); hint_label->add_theme_style_override("normal", label_style); hb->add_child(hint_label); @@ -840,7 +841,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) { offset->set_custom_minimum_size(Size2(0, 4 * EDSCALE)); node->add_child(offset); - String error = vsnode->get_warning(visual_shader->get_mode(), p_type); + String error = vsnode->get_warning(mode, p_type); if (!error.is_empty()) { Label *error_label = memnew(Label); error_label->add_theme_color_override("font_color", editor->get_theme_color(SNAME("error_color"), SNAME("Editor"))); |