24 lines
		
	
	
		
			804 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			804 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from lnx.logicnode.lnx_nodes import *
 | |
| 
 | |
| class ContainsStringNode(LnxLogicTreeNode):
 | |
|     """Returns whether the given string contains a given part."""
 | |
|     bl_idname = 'LNContainsStringNode'
 | |
|     bl_label = 'String Contains'
 | |
|     lnx_version = 1
 | |
|     property0: HaxeEnumProperty(
 | |
|         'property0',
 | |
|         items = [('Contains', 'Contains', 'Contains'),
 | |
|                  ('Starts With', 'Starts With', 'Starts With'),
 | |
|                  ('Ends With', 'Ends With', 'Ends With'),
 | |
|                  ],
 | |
|         name='', default='Contains')
 | |
| 
 | |
|     def lnx_init(self, context):
 | |
|         self.add_input('LnxStringSocket', 'String')
 | |
|         self.add_input('LnxStringSocket', 'Find')
 | |
| 
 | |
|         self.add_output('LnxBoolSocket', 'Contains')
 | |
| 
 | |
|     def draw_buttons(self, context, layout):
 | |
|         layout.prop(self, 'property0')
 |