Add ability to look at tactical mode item info.
This commit is contained in:
@@ -53,3 +53,8 @@ class Mode(ItemAttrShortcut, HandledItem):
|
|||||||
for effect in self.item.effects.itervalues():
|
for effect in self.item.effects.itervalues():
|
||||||
if effect.runTime == runTime and effect.activeByDefault:
|
if effect.runTime == runTime and effect.activeByDefault:
|
||||||
effect.handler(fit, self, context=("module",))
|
effect.handler(fit, self, context=("module",))
|
||||||
|
|
||||||
|
def getValidCharges(self):
|
||||||
|
# Modes don't have charges, but it is queried for so return nothing.
|
||||||
|
validCharges = set()
|
||||||
|
return validCharges
|
||||||
|
|||||||
@@ -339,7 +339,11 @@ class FittingView(d.Display):
|
|||||||
def removeModule(self, module):
|
def removeModule(self, module):
|
||||||
sFit = service.Fit.getInstance()
|
sFit = service.Fit.getInstance()
|
||||||
fit = sFit.getFit(self.activeFitID)
|
fit = sFit.getFit(self.activeFitID)
|
||||||
populate = sFit.removeModule(self.activeFitID, fit.modules.index(module))
|
try:
|
||||||
|
populate = sFit.removeModule(self.activeFitID, fit.modules.index(module))
|
||||||
|
except ValueError:
|
||||||
|
# This module isn't in our list of modules, don't remove anything. Likely a special snowflake.
|
||||||
|
populate = None
|
||||||
|
|
||||||
if populate is not None:
|
if populate is not None:
|
||||||
self.slotsChanged()
|
self.slotsChanged()
|
||||||
@@ -441,12 +445,11 @@ class FittingView(d.Display):
|
|||||||
if fit.mode:
|
if fit.mode:
|
||||||
# Modes are special snowflakes and need a little manual loving
|
# Modes are special snowflakes and need a little manual loving
|
||||||
# We basically append the Mode rack and Mode to the modules
|
# We basically append the Mode rack and Mode to the modules
|
||||||
# while also marking their positions in the Blanks list
|
# while also marking the mode header position in the Blanks list
|
||||||
if sFit.serviceFittingOptions["rackSlots"]:
|
if sFit.serviceFittingOptions["rackSlots"]:
|
||||||
self.blanks.append(len(self.mods))
|
self.blanks.append(len(self.mods))
|
||||||
self.mods.append(Rack.buildRack(Slot.MODE))
|
self.mods.append(Rack.buildRack(Slot.MODE))
|
||||||
|
|
||||||
self.blanks.append(len(self.mods))
|
|
||||||
self.mods.append(fit.mode)
|
self.mods.append(fit.mode)
|
||||||
else:
|
else:
|
||||||
self.mods = None
|
self.mods = None
|
||||||
@@ -488,12 +491,26 @@ class FittingView(d.Display):
|
|||||||
|
|
||||||
while sel != -1 and sel not in self.blanks:
|
while sel != -1 and sel not in self.blanks:
|
||||||
mod = self.mods[self.GetItemData(sel)]
|
mod = self.mods[self.GetItemData(sel)]
|
||||||
|
|
||||||
|
# Test if mod.isEmpty exists.
|
||||||
|
try:
|
||||||
|
mod.isEmpty
|
||||||
|
except AttributeError:
|
||||||
|
mod.isEmpty = False
|
||||||
|
|
||||||
if not mod.isEmpty:
|
if not mod.isEmpty:
|
||||||
srcContext = "fittingModule"
|
srcContext = "fittingModule"
|
||||||
itemContext = sMkt.getCategoryByItem(mod.item).name
|
itemContext = sMkt.getCategoryByItem(mod.item).name
|
||||||
fullContext = (srcContext, itemContext)
|
fullContext = (srcContext, itemContext)
|
||||||
if not srcContext in tuple(fCtxt[0] for fCtxt in contexts):
|
if not srcContext in tuple(fCtxt[0] for fCtxt in contexts):
|
||||||
contexts.append(fullContext)
|
contexts.append(fullContext)
|
||||||
|
|
||||||
|
# Test if mod.charge exists
|
||||||
|
try:
|
||||||
|
mod.charge
|
||||||
|
except AttributeError:
|
||||||
|
mod.charge = None
|
||||||
|
|
||||||
if mod.charge is not None:
|
if mod.charge is not None:
|
||||||
srcContext = "fittingCharge"
|
srcContext = "fittingCharge"
|
||||||
itemContext = sMkt.getCategoryByItem(mod.charge).name
|
itemContext = sMkt.getCategoryByItem(mod.charge).name
|
||||||
|
|||||||
Reference in New Issue
Block a user