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()
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()
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()
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))
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()
def closeEvent(self, event): #del self.disableWin wx.PostEvent(self.mainFrame, GE.CharListUpdated()) self.Destroy()
def revertChar(self, event): sChr = service.Character.getInstance() char = self.entityEditor.getActiveEntity() sChr.revertCharacter(char.ID) wx.PostEvent(self, GE.CharListUpdated())
def editingFinished(self, event): #del self.disableWin wx.PostEvent(self.mainFrame, GE.CharListUpdated()) self.Destroy()
def importCharacterCallback(self): self.waitDialog.Destroy() wx.PostEvent(self, GE.CharListUpdated())
def saveCharAs(self, event): char = self.entityEditor.getActiveEntity() self.SaveCharacterAs(self, char.ID) wx.PostEvent(self, GE.CharListUpdated())
def importCharacterCallback(self): self.closeWaitDialog() wx.PostEvent(self, GE.CharListUpdated())
def revertChar(self, event): sChr = Character.getInstance() charID = self.charSelection.getActiveCharacter() sChr.revertCharacter(charID) wx.PostEvent(self, GE.CharListUpdated())
def saveCharAs(self, event): charID = self.charSelection.getActiveCharacter() CharacterEditor.SaveCharacterAs(self, charID) wx.PostEvent(self, GE.CharListUpdated())
def revertChar(self, event): sChr = service.Character.getInstance() charID = self.getActiveCharacter() sChr.revertCharacter(charID) self.sview.populateSkillTree() wx.PostEvent(self, GE.CharListUpdated())
def closeWindow(self): wx.PostEvent(self.mainFrame, GE.CharListUpdated()) self.Destroy()