Added async equivalent to resolve_input_port_value

For some stuff an async version of this function was needed.  This is *probably* going to be removed when we move most of the stuff to being async. But for this branch at least this allows some nodes to work.
This commit is contained in:
Eroax 2024-01-22 20:05:46 -07:00
parent 5feb293bdf
commit c7c2e0ca6b

View file

@ -319,6 +319,15 @@ func resolve_input_port_value(input_port: int) -> Variant:
else: else:
return null return null
func resolve_input_port_value_async(input_port: int) -> Variant:
if await request_value_async(input_port) != null:
return await request_value_async(input_port)
elif get_input_ports()[input_port].value_callback.get_object() && get_input_ports()[input_port].value_callback.call() != null:
return get_input_ports()[input_port].value_callback.call()
elif get_input_ports()[input_port].value != null:
return get_input_ports()[input_port].value
else:
return null
## Returns a [Dictionary] representation of this node. ## Returns a [Dictionary] representation of this node.
func to_dict(with_meta: bool = true) -> Dictionary: func to_dict(with_meta: bool = true) -> Dictionary: