summaryrefslogtreecommitdiffstats
path: root/editor/plugins/visual_shader_editor_plugin.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-09-22 22:05:10 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-09-22 22:05:10 +0200
commitf795e458680ce5d7879e5556f8606aa96a6832a8 (patch)
tree4d5cedb1948597fed6b4332b887bd4ba434ae411 /editor/plugins/visual_shader_editor_plugin.cpp
parentd65d379d22ee24593843d28800eec1fd446d1dd3 (diff)
parentf248420a2b721bc3d54e3335c3d5888caad0d113 (diff)
downloadredot-engine-f795e458680ce5d7879e5556f8606aa96a6832a8.tar.gz
Merge pull request #82088 from DennisManaa/qbie/expand-ports
Visual Shaders: Make output-ports for vector types expandable by default
Diffstat (limited to 'editor/plugins/visual_shader_editor_plugin.cpp')
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index b9b47c475b..d952a7be1e 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -859,11 +859,11 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
}
if (valid_right) {
- if (vsnode->is_output_port_expandable(i)) {
+ if (expanded_port_counter == 0 && vsnode->is_output_port_expandable(i)) {
TextureButton *expand = memnew(TextureButton);
expand->set_toggle_mode(true);
- expand->set_texture_normal(editor->get_editor_theme_icon(SNAME("GuiTreeArrowDown")));
- expand->set_texture_pressed(editor->get_editor_theme_icon(SNAME("GuiTreeArrowRight")));
+ expand->set_texture_normal(editor->get_editor_theme_icon(SNAME("GuiTreeArrowRight")));
+ expand->set_texture_pressed(editor->get_editor_theme_icon(SNAME("GuiTreeArrowDown")));
expand->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
expand->set_pressed(vsnode->_is_output_port_expanded(i));
expand->connect("pressed", callable_mp(editor, &VisualShaderEditor::_expand_output_port).bind(p_id, i, !vsnode->_is_output_port_expanded(i)), CONNECT_DEFERRED);
@@ -892,6 +892,9 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
if (!is_first_hbox) {
node->add_child(hb);
+ if (curve_xyz.is_valid()) {
+ node->move_child(hb, 1 + expanded_port_counter);
+ }
}
if (expanded_type != VisualShaderNode::PORT_TYPE_SCALAR) {