2018-07-04 11:49:48 +02:00
|
|
|
from arm.logicnode.arm_nodes import *
|
|
|
|
|
2020-09-08 21:16:20 +02:00
|
|
|
class ContainsStringNode(ArmLogicTreeNode):
|
2020-09-08 23:14:51 +02:00
|
|
|
"""Contains string node"""
|
2018-07-04 11:49:48 +02:00
|
|
|
bl_idname = 'LNContainsStringNode'
|
|
|
|
bl_label = 'Contains String'
|
2020-09-13 11:27:58 +02:00
|
|
|
arm_version = 1
|
2018-12-18 23:48:38 +01:00
|
|
|
property0: EnumProperty(
|
2018-07-04 11:49:48 +02:00
|
|
|
items = [('Contains', 'Contains', 'Contains'),
|
|
|
|
('Starts With', 'Starts With', 'Starts With'),
|
|
|
|
('Ends With', 'Ends With', 'Ends With'),
|
|
|
|
],
|
|
|
|
name='', default='Contains')
|
2020-09-08 17:03:24 +02:00
|
|
|
|
2018-07-04 11:49:48 +02:00
|
|
|
def init(self, context):
|
2020-09-13 11:27:58 +02:00
|
|
|
super(ContainsStringNode, self).init(context)
|
2020-09-08 21:49:02 +02:00
|
|
|
self.add_input('NodeSocketString', 'String')
|
|
|
|
self.add_input('NodeSocketString', 'Find')
|
|
|
|
self.add_output('NodeSocketBool', 'Bool')
|
2018-07-04 11:49:48 +02:00
|
|
|
|
|
|
|
def draw_buttons(self, context, layout):
|
|
|
|
layout.prop(self, 'property0')
|
|
|
|
|
2020-09-09 20:48:35 +02:00
|
|
|
add_node(ContainsStringNode, category=PKG_AS_CATEGORY)
|