Ejemplo n.º 1
0
def componentNameSearchEnumerator(typeId, context, option):
    if not context in ['component_creation']: return None
    registry = _MOCK.getComponentRegistry()
    result = []
    for name in sorted(registry.keys()):
        entry = (name, name, 'Entity', None)
        result.append(entry)
    return result
Ejemplo n.º 2
0
def componentNameSearchEnumerator( typeId, context, option ):
	if not context in [ 'component_creation' ] : return None
	registry = _MOCK.getComponentRegistry()
	result = []
	for name in sorted( registry.keys() ):
		entry = ( name, name, 'Entity', None )
		result.append( entry )
	return result
Ejemplo n.º 3
0
    def refreshCreatorMenu(self):
        def addEntityMenuItem(name):
            if name == '----':
                self.entityCreatorMenu.addChild('----')
                return
            self.entityCreatorMenu.addChild({
                'name': 'create_entity_' + name,
                'label': name,
                'command': 'scene_editor/create_entity',
                'command_args': dict(name=name)
            })

        def addComponentMenuItem(name):
            if name == '----':
                self.componentCreatorMenu.addChild('----')
                return
            self.componentCreatorMenu.addChild({
                'name': 'create_component_' + name,
                'label': name,
                'command': 'scene_editor/create_component',
                'command_args': dict(name=name)
            })

        self.entityCreatorMenu.clear()
        self.componentCreatorMenu.clear()

        registry = _MOCK.getEntityRegistry()
        #entity
        keys = sorted(registry.keys())
        addEntityMenuItem('Entity')
        addEntityMenuItem('----')
        for entityName in sorted(registry.keys()):
            if entityName != 'Entity': addEntityMenuItem(entityName)

        #component
        registry = _MOCK.getComponentRegistry()
        for comName in sorted(registry.keys()):
            addComponentMenuItem(comName)
Ejemplo n.º 4
0
	def refreshCreatorMenu( self ):
		def addEntityMenuItem( name ):
			if name == '----': 
				self.entityCreatorMenu.addChild( '----' )
				return
			self.entityCreatorMenu.addChild({
					'name'     : 'create_entity_'+name,
					'label'    : name,
					'command'  : 'scene_editor/create_entity',
					'command_args' : dict( name = name )
				})

		def addComponentMenuItem( name ):
			if name == '----': 
				self.componentCreatorMenu.addChild( '----' )
				return
			self.componentCreatorMenu.addChild({
					'name'     : 'create_component_'+name,
					'label'    : name,
					'command'  : 'scene_editor/create_component',
					'command_args' : dict( name = name )
				})

		self.entityCreatorMenu.clear()
		self.componentCreatorMenu.clear()

		registry = _MOCK.getEntityRegistry()
		#entity
		keys = sorted( registry.keys() )
		addEntityMenuItem( 'Entity' )
		addEntityMenuItem( '----' )
		for entityName in sorted( registry.keys() ):
			if entityName!='Entity': addEntityMenuItem( entityName )

		#component
		registry = _MOCK.getComponentRegistry()
		for comName in sorted( registry.keys() ):
			addComponentMenuItem( comName )