From c7c2e0ca6bdb34b23e92294646b65691b9fcf474 Mon Sep 17 00:00:00 2001 From: Eroax Date: Mon, 22 Jan 2024 20:05:46 -0700 Subject: [PATCH] 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. --- classes/deck/deck_node.gd | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/classes/deck/deck_node.gd b/classes/deck/deck_node.gd index dd46b26..3876f31 100644 --- a/classes/deck/deck_node.gd +++ b/classes/deck/deck_node.gd @@ -319,6 +319,15 @@ func resolve_input_port_value(input_port: int) -> Variant: else: 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. func to_dict(with_meta: bool = true) -> Dictionary: