mirror of
https://codeberg.org/StreamGraph/StreamGraph.git
synced 2024-11-13 19:49:55 +01:00
add input and deck variables access to expression node
This commit is contained in:
parent
3be669da28
commit
464d0a0e33
1 changed files with 15 additions and 3 deletions
|
@ -10,7 +10,19 @@ func _init():
|
||||||
|
|
||||||
props_to_serialize = []
|
props_to_serialize = []
|
||||||
|
|
||||||
add_output_port(DeckType.Types.ANY, "Expression Text", "codeblock")
|
# TODO: order of ports is changed
|
||||||
|
# due to https://github.com/godotengine/godot/issues/85558
|
||||||
|
# when it's fixed, switch it back
|
||||||
|
add_input_port(
|
||||||
|
DeckType.Types.DICTIONARY,
|
||||||
|
"Expression Input"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_output_port(
|
||||||
|
DeckType.Types.STRING,
|
||||||
|
"Expression Text",
|
||||||
|
"codeblock"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,14 +30,14 @@ func _value_request(_from_port : int) -> Variant:
|
||||||
|
|
||||||
var text = get_output_ports()[0].value_callback.call()
|
var text = get_output_ports()[0].value_callback.call()
|
||||||
|
|
||||||
var err = expr.parse(text)
|
var err = expr.parse(text, ["deck_var", "input"])
|
||||||
if err != OK:
|
if err != OK:
|
||||||
|
|
||||||
printerr(err)
|
printerr(err)
|
||||||
return null
|
return null
|
||||||
|
|
||||||
|
|
||||||
var res = expr.execute()
|
var res = expr.execute([_belonging_to.variable_stack, request_value(0)])
|
||||||
if expr.has_execute_failed():
|
if expr.has_execute_failed():
|
||||||
|
|
||||||
printerr("Expression Execution Failed: ", text)
|
printerr("Expression Execution Failed: ", text)
|
||||||
|
|
Loading…
Reference in a new issue