add args to the call of haxe static function

This commit is contained in:
t3du 2021-10-19 19:11:10 -03:00 committed by GitHub
parent b9b5c65141
commit 4fe8f683dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
from arm.logicnode.arm_nodes import *
class CallHaxeStaticNode(ArmLogicTreeNode):
"""Calls the given static Haxe function.
"""Calls the given static Haxe function with args (before it was using [tree] instead of args)
@input Function: the full module path to the function.
@output Result: the result of the function."""
@ -10,9 +10,22 @@ class CallHaxeStaticNode(ArmLogicTreeNode):
arm_section = 'haxe'
arm_version = 1
def __init__(self):
array_nodes[str(id(self))] = self
def arm_init(self, context):
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmStringSocket', 'Function')
self.add_output('ArmNodeSocketAction', 'Out')
self.add_output('ArmDynamicSocket', 'Result')
def draw_buttons(self, context, layout):
row = layout.row(align=True)
op = row.operator('arm.node_add_input', text='Add Arg', icon='PLUS', emboss=True)
op.node_index = str(id(self))
op.socket_type = 'ArmDynamicSocket'
op.name_format = "Arg {0}"
op.index_name_offset = -2
op2 = row.operator('arm.node_remove_input', text='', icon='X', emboss=True)
op2.node_index = str(id(self))