예제 #1
0
 def onEntityAdded(self, entity, context=None):
     if context == 'new':
         self.setFocus()
         pnode = entity.parent
         if pnode:
             self.tree.setNodeExpanded(pnode, True)
         self.tree.setFocus()
         # self.tree.editNode (entity)
         self.tree.selectNode(entity)
     signals.emit('scene.update')
     self.markSceneDirty()
예제 #2
0
    def execCommand(self):
        text = self.luaConsoleInput.text()
        self.history.append(text)
        if len(self.history) > 10: self.history.pop(1)
        self.historyCursor = len(self.history)
        self.luaConsoleInput.clear()
        self.appendText(self.module.stdoutCapture.read())
        self.appendText(">>")
        self.appendText(text)
        self.appendText("\n")

        signals.emit('console.exec', text.encode('utf-8'))
예제 #3
0
 def toggleSolo(self, layer):
     solo = layer.isEditorSolo(layer)
     if solo:
         self.tree.hasSoloLayer = False
         for l in _CANDY.game.layers.values():
             if l.name == 'CANDY_EDITOR_LAYER': continue
             if l != layer:
                 l.editorSolo = False
         layer.setEditorSolo(layer, False)
     else:
         self.tree.hasSoloLayer = True
         for l in _CANDY.game.layers.values():
             if l.name == 'CANDY_EDITOR_LAYER': continue
             if l != layer:
                 l.editorSolo = 'hidden'
         layer.setEditorSolo(layer, True)
     self.tree.refreshAllContent()
     signals.emit('scene.update')
예제 #4
0
 def on_moved(self, event):
     super(FileWatcherEventHandler, self).on_moved(event)
     signals.emit('file.moved', event.src_path, event.dest_path)
예제 #5
0
 def on_deleted(self, event):
     super(FileWatcherEventHandler, self).on_deleted(event)
     signals.emit('file.removed', event.src_path)
예제 #6
0
 def on_created(self, event):
     super(FileWatcherEventHandler, self).on_created(event)
     signals.emit('file.added', event.src_path)
예제 #7
0
 def toggleLock(self, layer):
     layer.locked = not layer.locked
     self.tree.refreshNodeContent(layer)
     signals.emit('scene.update')
예제 #8
0
 def toggleEditVisible(self, layer):
     layer.setEditorVisible(layer, not layer.isEditorVisible(layer))
     self.tree.refreshNodeContent(layer)
     signals.emit('scene.update')
예제 #9
0
 def toggleHidden(self, layer):
     layer.setVisible(layer, not layer.isVisible(layer))
     self.tree.refreshNodeContent(layer)
     signals.emit('scene.update')
예제 #10
0
 def onComponentRemoved(self, com, entity):
     signals.emit('scene.update')
     self.markSceneDirty()
예제 #11
0
 def onEntityRemoved(self, entity):
     signals.emit('scene.update')
     self.markSceneDirty()
예제 #12
0
 def renameEntity(self, target, name):
     #TODO:command pattern
     target.setName(target, name)
     signals.emit('entity.modified', target)