Пример #1
0
    def change(self, event):
        sChar = service.Character.getInstance()
        sChar.saveCharacterAs(self.charID, self.input.GetLineText(0))
        wx.PostEvent(self.parent, GE.CharListUpdated())

        event.Skip()
        self.Close()
Пример #2
0
    def changeLevel(self, event):
        level = self.levelIds.get(event.Id)

        sChar = service.Character.getInstance()
        charID = self.Parent.Parent.getActiveCharacter()
        selection = self.skillTreeListCtrl.GetSelection()
        skillID = self.skillTreeListCtrl.GetPyData(selection)

        if level is not None:
            self.skillTreeListCtrl.SetItemText(
                selection,
                "Level %d" % level if isinstance(level, int) else level, 1)
            sChar.changeLevel(charID, skillID, level, persist=True)
        elif event.Id == self.revertID:
            sChar.revertLevel(charID, skillID)
        elif event.Id == self.saveID:
            sChar.saveSkill(charID, skillID)

        self.skillTreeListCtrl.SetItemTextColour(selection, None)

        dirtySkills = sChar.getDirtySkills(charID)
        dirtyGroups = set([skill.item.group.ID for skill in dirtySkills])

        parentID = self.skillTreeListCtrl.GetItemParent(selection)
        groupID = self.skillTreeListCtrl.GetPyData(parentID)

        if groupID not in dirtyGroups:
            self.skillTreeListCtrl.SetItemTextColour(parentID, None)

        wx.PostEvent(self.Parent.Parent, GE.CharListUpdated())
        event.Skip()
Пример #3
0
 def OnClose(self, event):
     wx.PostEvent(self.mainFrame, GE.CharListUpdated())
     sFit = Fit.getInstance()
     fitID = self.mainFrame.getActiveFit()
     if fitID is not None:
         sFit.clearFit(fitID)
         wx.PostEvent(self.mainFrame, GE.FitChanged(fitIDs=(fitID,)))
     event.Skip()
Пример #4
0
    def handleSkillChange(self, event):
        skill, level = self.skillIds[event.Id]

        self.sChar.changeLevel(self.charID, skill.item.ID, level)
        fitID = self.mainFrame.getActiveFit()
        self.sFit.changeChar(fitID, self.charID)

        wx.PostEvent(self.mainFrame, GE.CharListUpdated())
        wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
Пример #5
0
 def ssoLogin(self, event):
     self.popCharList()
     sChar = Character.getInstance()
     # Update existing pyfa character, if it doesn't exist - create new
     char = sChar.getCharacter(event.character.characterName)
     newChar = False
     if char is None:
         char = sChar.new(event.character.characterName)
         newChar = True
     char.setSsoCharacter(event.character, config.getClientSecret())
     sChar.apiFetch(char.ID, APIView.fetchCallback)
     wx.PostEvent(self.mainFrame, GE.CharListUpdated())
     event.Skip()
Пример #6
0
 def closeEvent(self, event):
     #del self.disableWin
     wx.PostEvent(self.mainFrame, GE.CharListUpdated())
     self.Destroy()
Пример #7
0
 def revertChar(self, event):
     sChr = service.Character.getInstance()
     char = self.entityEditor.getActiveEntity()
     sChr.revertCharacter(char.ID)
     wx.PostEvent(self, GE.CharListUpdated())
Пример #8
0
 def editingFinished(self, event):
     #del self.disableWin
     wx.PostEvent(self.mainFrame, GE.CharListUpdated())
     self.Destroy()
Пример #9
0
 def importCharacterCallback(self):
     self.waitDialog.Destroy()
     wx.PostEvent(self, GE.CharListUpdated())
Пример #10
0
 def saveCharAs(self, event):
     char = self.entityEditor.getActiveEntity()
     self.SaveCharacterAs(self, char.ID)
     wx.PostEvent(self, GE.CharListUpdated())
Пример #11
0
 def importCharacterCallback(self):
     self.closeWaitDialog()
     wx.PostEvent(self, GE.CharListUpdated())
Пример #12
0
 def revertChar(self, event):
     sChr = Character.getInstance()
     charID = self.charSelection.getActiveCharacter()
     sChr.revertCharacter(charID)
     wx.PostEvent(self, GE.CharListUpdated())
Пример #13
0
 def saveCharAs(self, event):
     charID = self.charSelection.getActiveCharacter()
     CharacterEditor.SaveCharacterAs(self, charID)
     wx.PostEvent(self, GE.CharListUpdated())
Пример #14
0
 def revertChar(self, event):
     sChr = service.Character.getInstance()
     charID = self.getActiveCharacter()
     sChr.revertCharacter(charID)
     self.sview.populateSkillTree()
     wx.PostEvent(self, GE.CharListUpdated())
Пример #15
0
 def closeWindow(self):
     wx.PostEvent(self.mainFrame, GE.CharListUpdated())
     self.Destroy()