From 3a7facf948a5109c0dfd542de5e299fde4be92da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Mon, 20 May 2024 05:25:34 +0000 Subject: [PATCH] make group input node use resolve instead of raw value request when getting value and disallow group output nodes having descriptors in sidebar (#159) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #158 Reviewed-on: https://codeberg.org/StreamGraph/StreamGraph/pulls/159 Co-authored-by: Lera ElvoƩ Co-committed-by: Lera ElvoƩ --- classes/deck/nodes/group/group_input_node.gd | 3 ++- graph_node_renderer/sidebar/sidebar.gd | 27 +++++++++++--------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/classes/deck/nodes/group/group_input_node.gd b/classes/deck/nodes/group/group_input_node.gd index c92b0d8..61b3be3 100644 --- a/classes/deck/nodes/group/group_input_node.gd +++ b/classes/deck/nodes/group/group_input_node.gd @@ -95,6 +95,7 @@ func _post_deck_load() -> void: func _value_request(from_port: int) -> Variant: if group_node: - return await group_node.request_value_async(group_node.get_input_ports()[from_port].index_of_type) + return await group_node.resolve_input_port_value_async(group_node.get_input_ports()[from_port].index_of_type) + #return await group_node.request_value_async(group_node.get_input_ports()[from_port].index_of_type) else: return null diff --git a/graph_node_renderer/sidebar/sidebar.gd b/graph_node_renderer/sidebar/sidebar.gd index 41abcbb..f067469 100644 --- a/graph_node_renderer/sidebar/sidebar.gd +++ b/graph_node_renderer/sidebar/sidebar.gd @@ -376,18 +376,21 @@ class GroupDescriptorsInspector: _menu.add_child(Inspector.new("Usage:", usage_combo)) - var descriptor_field := LineEdit.new() - descriptor_field.placeholder_text = "Descriptor (advanced)" - descriptor_field.tooltip_text = "Advanced use only.\nSeparate arguments with colon (:).\nPress Enter to confirm." - - descriptor_field.text = port_override.descriptor - - descriptor_field.text_submitted.connect( - func(new_text: String) -> void: - port_override.descriptor = new_text - ) - - _menu.add_child(Inspector.new("Descriptor:", descriptor_field)) + if input: + # descriptors are very rarely used on output ports. when they are, + # the nodes are fairly special, so we're not going to allow them on groups. + var descriptor_field := LineEdit.new() + descriptor_field.placeholder_text = "Descriptor (advanced)" + descriptor_field.tooltip_text = "Advanced use only.\nSeparate arguments with colon (:).\nPress Enter to confirm." + + descriptor_field.text = port_override.descriptor + + descriptor_field.text_submitted.connect( + func(new_text: String) -> void: + port_override.descriptor = new_text + ) + + _menu.add_child(Inspector.new("Descriptor:", descriptor_field)) io_menu.add_child(_menu)