Merge branch 'master' into test-3

This commit is contained in:
blitzmann
2018-03-01 00:40:40 -05:00
3 changed files with 14 additions and 7 deletions

View File

@@ -120,10 +120,10 @@ class Character(object):
return all0
def apiUpdateCharSheet(self, skills, secStatus=0):
del self.__skills[:]
self.__skillIdMap.clear()
for skillRow in skills:
self.addSkill(Skill(self, skillRow["typeID"], skillRow["level"]))
skill = self.getSkill(int(skillRow["typeID"]))
skill.setLevel(int(skillRow["level"]), persist=True, ignoreRestrict=True)
self.secStatus = secStatus
@property

View File

@@ -99,15 +99,22 @@ class ProjectedView(d.Display):
data[0] is hard-coded str of originating source
data[1] is typeID or index of data we want to manipulate
"""
sFit = Fit.getInstance()
fit = sFit.getFit(self.mainFrame.getActiveFit())
if data[0] == "projected":
# if source is coming from projected, we are trying to combine drones.
self.mergeDrones(x, y, int(data[1]))
elif data[0] == "fitting":
dstRow, _ = self.HitTest((x, y))
# Gather module information to get position
module = fit.modules[int(data[1])]
sFit.project(fit.ID, module.item.ID)
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fit.ID))
elif data[0] == "market":
sFit = Fit.getInstance()
fitID = self.mainFrame.getActiveFit()
sFit.project(fitID, int(data[1]))
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.mainFrame.getActiveFit()))
sFit.project(fit.ID, int(data[1]))
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fit.ID))
def kbEvent(self, event):
keycode = event.GetKeyCode()

View File

@@ -66,7 +66,7 @@ class CharacterImportThread(threading.Thread):
with open(path, mode='r') as charFile:
sheet = ParseXML(charFile)
char = sCharacter.new(sheet.name + " (imported)")
sCharacter.apiUpdateCharSheet(char.ID, sheet.skills)
sCharacter.apiUpdateCharSheet(char.ID, sheet.skills, 0)
except:
# if it's not api XML data, try this
# this is a horrible logic flow, but whatever