Create a new property on Module, returns if module is projected (or None if it's not attached to a fit). Fix issues with setting charges on projected modules because the command was always looking at the literal modules on the fit (instead of projected)

This commit is contained in:
blitzmann
2018-12-01 20:50:40 -05:00
parent 791b6e15d4
commit 194c159379
4 changed files with 16 additions and 6 deletions

View File

@@ -272,7 +272,13 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
@property
def modPosition(self):
if self.owner:
return self.owner.modules.index(self)
return self.owner.modules.index(self) if not self.isProjected else self.owner.projectedModules.index(self)
@property
def isProjected(self):
if self.owner:
return self in self.owner.projectedModules
return None
@property
def isCapitalSize(self):