change version and add NodeReplacement

This commit is contained in:
t3du 2021-10-20 11:15:06 -03:00 committed by GitHub
parent 89ff1c29fc
commit 6b1333902c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,7 @@ class CallHaxeStaticNode(ArmLogicTreeNode):
bl_idname = 'LNCallHaxeStaticNode'
bl_label = 'Call Haxe Static'
arm_section = 'haxe'
arm_version = 1
arm_version = 2
def __init__(self):
array_nodes[str(id(self))] = self
@ -31,3 +31,12 @@ class CallHaxeStaticNode(ArmLogicTreeNode):
op.index_name_offset = -2
op2 = row.operator('arm.node_remove_input', text='', icon='X', emboss=True)
op2.node_index = str(id(self))
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.arm_version not in (0, 1):
raise LookupError()
return NodeReplacement(
'LNCallHaxeStaticNode', self.arm_version, 'LNCallHaxeStaticNode', 2,
in_socket_mapping={0:0, 1:1}, out_socket_mapping={0:0, 1:1}
)