Adds import support for fitting window copy. Resolves #91

This requires us to pass an active fit to use as a base for the modules, as the format does not include ship information. Features:
* If active fit has modules, makes a new fit using same ship
* Does basic dummy checking. As the format doesn't include ship info, it will probably be common for someone to accidentally try to import a Legion fit to a Rifter by mistake. Import logic checks module legality for fit and, if fails, silently halts import without saving.
This commit is contained in:
blitzmann
2014-05-14 23:39:47 -04:00
parent 40c1bc8ae6
commit f9c141fa25
3 changed files with 100 additions and 6 deletions

View File

@@ -744,8 +744,8 @@ class Fit(object):
fit.damagePattern = self.pattern
return fits
def importFitFromBuffer(self, buffer):
type,fits = eos.types.Fit.importAuto(buffer)
def importFitFromBuffer(self, buffer, activeFit=None):
type,fits = eos.types.Fit.importAuto(buffer, activeFit=activeFit)
for fit in fits:
fit.character = self.character
fit.damagePattern = self.pattern