Пример #1
0
    def handleSelection(self, event):
        set = self.idmap.get(event.Id, None)

        if set is None:
            event.Skip()
            return

        if self.context == "implantEditor":
            # we are calling from character editor, the implant source is different
            sChar = Character.getInstance()
            char = self.mainItem.entityEditor.getActiveEntity()

            for implant in set.implants:
                sChar.addImplant(char.ID, implant.item.ID)

            wx.PostEvent(self.mainItem, GE.CharChanged())
        else:
            self.mainFrame.command.Submit(cmd.GuiAddImplantSetCommand(
                fitID=self.mainFrame.getActiveFit(),
                itemIDs=[i.itemID for i in set.implants]))
Пример #2
0
 def addImplants(self, implants):
     self.mainFrame.command.Submit(
         cmd.GuiAddImplantSetCommand(fitID=self.mainFrame.getActiveFit(),
                                     itemIDs=[i.itemID for i in implants]))