Merge branch 'master' into market_metagroups
This commit is contained in:
@@ -113,7 +113,7 @@ def defPaths(customSavePath=None):
|
||||
# Version data
|
||||
|
||||
with open(os.path.join(pyfaPath, "version.yml"), 'r') as file:
|
||||
data = yaml.load(file, Loader=yaml.FullLoader)
|
||||
data = yaml.load(file, Loader=yaml.SafeLoader)
|
||||
version = data['version']
|
||||
|
||||
# Where we store the saved fits etc, default is the current users home directory
|
||||
|
||||
@@ -8,7 +8,7 @@ import yaml
|
||||
|
||||
|
||||
with open("version.yml", 'r') as file:
|
||||
data = yaml.load(file, Loader=yaml.FullLoader)
|
||||
data = yaml.load(file, Loader=yaml.SafeLoader)
|
||||
version = data['version']
|
||||
|
||||
os.environ["PYFA_DIST_DIR"] = os.path.join(os.getcwd(), 'dist')
|
||||
|
||||
@@ -140,12 +140,18 @@ class Effect(EqBase):
|
||||
Whether this effect is implemented in code or not,
|
||||
unimplemented effects simply do nothing at all when run
|
||||
"""
|
||||
if not self.__generated:
|
||||
self.__generateHandler()
|
||||
|
||||
return self.__effectDef is not None
|
||||
|
||||
def isType(self, type):
|
||||
"""
|
||||
Check if this effect is of the passed type
|
||||
"""
|
||||
if not self.__generated:
|
||||
self.__generateHandler()
|
||||
|
||||
return self.type is not None and type in self.type
|
||||
|
||||
def __generateHandler(self):
|
||||
|
||||
@@ -33,13 +33,20 @@ class ItemAttrShortcut(object):
|
||||
|
||||
return return_value or default
|
||||
|
||||
def getBaseAttrValue(self, key, default=0):
|
||||
def getItemBaseAttrValue(self, key, default=0):
|
||||
"""
|
||||
Gets base value in this order:
|
||||
Mutated value > override value > attribute value
|
||||
"""
|
||||
return_value = self.itemModifiedAttributes.getOriginal(key)
|
||||
return return_value or default
|
||||
|
||||
def getChargeBaseAttrValue(self, key, default=0):
|
||||
"""
|
||||
Gets base value in this order:
|
||||
Mutated value > override value > attribute value
|
||||
"""
|
||||
return_value = self.chargeModifiedAttributes.getOriginal(key)
|
||||
return return_value or default
|
||||
|
||||
|
||||
|
||||
@@ -69,10 +69,7 @@ class BoosterView(d.Display):
|
||||
|
||||
self.SetDropTarget(BoosterViewDrop(self.handleListDrag))
|
||||
|
||||
if "__WXGTK__" in wx.PlatformInfo:
|
||||
self.Bind(wx.EVT_RIGHT_UP, self.scheduleMenu)
|
||||
else:
|
||||
self.Bind(wx.EVT_RIGHT_DOWN, self.scheduleMenu)
|
||||
self.Bind(wx.EVT_CONTEXT_MENU, self.spawnMenu)
|
||||
|
||||
def handleListDrag(self, x, y, data):
|
||||
"""
|
||||
@@ -163,12 +160,7 @@ class BoosterView(d.Display):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
self.mainFrame.command.Submit(cmd.GuiToggleBoosterCommand(fitID, row))
|
||||
|
||||
def scheduleMenu(self, event):
|
||||
event.Skip()
|
||||
if self.getColumn(event.Position) != self.getColIndex(State):
|
||||
wx.CallAfter(self.spawnMenu)
|
||||
|
||||
def spawnMenu(self):
|
||||
def spawnMenu(self, event):
|
||||
sel = self.GetFirstSelected()
|
||||
if sel != -1:
|
||||
sFit = Fit.getInstance()
|
||||
|
||||
@@ -64,10 +64,7 @@ class CargoView(d.Display):
|
||||
self.SetDropTarget(CargoViewDrop(self.handleListDrag))
|
||||
self.Bind(wx.EVT_LIST_BEGIN_DRAG, self.startDrag)
|
||||
|
||||
if "__WXGTK__" in wx.PlatformInfo:
|
||||
self.Bind(wx.EVT_RIGHT_UP, self.scheduleMenu)
|
||||
else:
|
||||
self.Bind(wx.EVT_RIGHT_DOWN, self.scheduleMenu)
|
||||
self.Bind(wx.EVT_CONTEXT_MENU, self.spawnMenu)
|
||||
|
||||
def handleListDrag(self, x, y, data):
|
||||
"""
|
||||
@@ -180,12 +177,7 @@ class CargoView(d.Display):
|
||||
sFit.removeCargo(fitID, self.original.index(cargo))
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||
|
||||
def scheduleMenu(self, event):
|
||||
event.Skip()
|
||||
if self.getColumn(event.Position) != self.getColIndex(State):
|
||||
wx.CallAfter(self.spawnMenu)
|
||||
|
||||
def spawnMenu(self):
|
||||
def spawnMenu(self,event):
|
||||
sel = self.GetFirstSelected()
|
||||
if sel != -1:
|
||||
sFit = Fit.getInstance()
|
||||
|
||||
@@ -72,16 +72,12 @@ class CommandView(d.Display):
|
||||
self.mainFrame.Bind(EVT_FIT_REMOVED, CommandFits.populateFits)
|
||||
self.mainFrame.Bind(GE.FIT_CHANGED, self.fitChanged)
|
||||
self.Bind(wx.EVT_LEFT_DOWN, self.click)
|
||||
self.Bind(wx.EVT_RIGHT_DOWN, self.click)
|
||||
self.Bind(wx.EVT_LEFT_DCLICK, self.remove)
|
||||
self.Bind(wx.EVT_KEY_UP, self.kbEvent)
|
||||
|
||||
self.droneView = gui.builtinAdditionPanes.droneView.DroneView
|
||||
|
||||
if "__WXGTK__" in wx.PlatformInfo:
|
||||
self.Bind(wx.EVT_RIGHT_UP, self.scheduleMenu)
|
||||
else:
|
||||
self.Bind(wx.EVT_RIGHT_DOWN, self.scheduleMenu)
|
||||
self.Bind(wx.EVT_RIGHT_UP, self.spawnMenu)
|
||||
|
||||
self.Bind(wx.EVT_LIST_BEGIN_DRAG, self.startDrag)
|
||||
self.SetDropTarget(CommandViewDrop(self.handleListDrag))
|
||||
@@ -188,12 +184,7 @@ class CommandView(d.Display):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
self.mainFrame.command.Submit(cmd.GuiToggleCommandCommand(fitID, item.ID))
|
||||
|
||||
def scheduleMenu(self, event):
|
||||
event.Skip()
|
||||
if self.getColumn(event.Position) != self.getColIndex(State):
|
||||
wx.CallAfter(self.spawnMenu)
|
||||
|
||||
def spawnMenu(self):
|
||||
def spawnMenu(self, event):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
if fitID is None:
|
||||
return
|
||||
|
||||
@@ -78,10 +78,7 @@ class DroneView(Display):
|
||||
self.Bind(wx.EVT_MOTION, self.OnMouseMove)
|
||||
self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeaveWindow)
|
||||
|
||||
if "__WXGTK__" in wx.PlatformInfo:
|
||||
self.Bind(wx.EVT_RIGHT_UP, self.scheduleMenu)
|
||||
else:
|
||||
self.Bind(wx.EVT_RIGHT_DOWN, self.scheduleMenu)
|
||||
self.Bind(wx.EVT_CONTEXT_MENU, self.spawnMenu)
|
||||
|
||||
self.Bind(wx.EVT_LIST_BEGIN_DRAG, self.startDrag)
|
||||
self.SetDropTarget(DroneViewDrop(self.handleDragDrop))
|
||||
@@ -242,12 +239,7 @@ class DroneView(Display):
|
||||
drone = self.drones[row]
|
||||
self.mainFrame.command.Submit(cmd.GuiToggleDroneCommand(fitID, self.original.index(drone)))
|
||||
|
||||
def scheduleMenu(self, event):
|
||||
event.Skip()
|
||||
if self.getColumn(event.Position) != self.getColIndex(State):
|
||||
wx.CallAfter(self.spawnMenu)
|
||||
|
||||
def spawnMenu(self):
|
||||
def spawnMenu(self, event):
|
||||
sel = self.GetFirstSelected()
|
||||
if sel != -1:
|
||||
drone = self.drones[sel]
|
||||
|
||||
@@ -142,10 +142,7 @@ class FighterDisplay(d.Display):
|
||||
self.Bind(wx.EVT_MOTION, self.OnMouseMove)
|
||||
self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeaveWindow)
|
||||
|
||||
if "__WXGTK__" in wx.PlatformInfo:
|
||||
self.Bind(wx.EVT_RIGHT_UP, self.scheduleMenu)
|
||||
else:
|
||||
self.Bind(wx.EVT_RIGHT_DOWN, self.scheduleMenu)
|
||||
self.Bind(wx.EVT_CONTEXT_MENU, self.spawnMenu)
|
||||
|
||||
self.Bind(wx.EVT_LIST_BEGIN_DRAG, self.startDrag)
|
||||
self.SetDropTarget(FighterViewDrop(self.handleDragDrop))
|
||||
@@ -289,12 +286,7 @@ class FighterDisplay(d.Display):
|
||||
fighter = self.fighters[row]
|
||||
self.mainFrame.command.Submit(cmd.GuiToggleFighterCommand(fitID, self.original.index(fighter)))
|
||||
|
||||
def scheduleMenu(self, event):
|
||||
event.Skip()
|
||||
if self.getColumn(event.Position) != self.getColIndex(State):
|
||||
wx.CallAfter(self.spawnMenu)
|
||||
|
||||
def spawnMenu(self):
|
||||
def spawnMenu(self, event):
|
||||
sel = self.GetFirstSelected()
|
||||
if sel != -1:
|
||||
fighter = self.fighters[sel]
|
||||
|
||||
@@ -118,11 +118,8 @@ class ImplantDisplay(d.Display):
|
||||
self.Bind(wx.EVT_KEY_UP, self.kbEvent)
|
||||
self.SetDropTarget(ImplantViewDrop(self.handleListDrag))
|
||||
|
||||
self.Bind(wx.EVT_CONTEXT_MENU, self.spawnMenu)
|
||||
|
||||
if "__WXGTK__" in wx.PlatformInfo:
|
||||
self.Bind(wx.EVT_RIGHT_UP, self.scheduleMenu)
|
||||
else:
|
||||
self.Bind(wx.EVT_RIGHT_DOWN, self.scheduleMenu)
|
||||
|
||||
def handleListDrag(self, x, y, data):
|
||||
"""
|
||||
@@ -223,12 +220,7 @@ class ImplantDisplay(d.Display):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
self.mainFrame.command.Submit(cmd.GuiToggleImplantCommand(fitID, row))
|
||||
|
||||
def scheduleMenu(self, event):
|
||||
event.Skip()
|
||||
if self.getColumn(event.Position) != self.getColIndex(State):
|
||||
wx.CallAfter(self.spawnMenu)
|
||||
|
||||
def spawnMenu(self):
|
||||
def spawnMenu(self, event):
|
||||
sel = self.GetFirstSelected()
|
||||
menu = None
|
||||
|
||||
|
||||
@@ -78,16 +78,12 @@ class ProjectedView(d.Display):
|
||||
|
||||
self.mainFrame.Bind(GE.FIT_CHANGED, self.fitChanged)
|
||||
self.Bind(wx.EVT_LEFT_DOWN, self.click)
|
||||
self.Bind(wx.EVT_RIGHT_DOWN, self.click)
|
||||
self.Bind(wx.EVT_LEFT_DCLICK, self.remove)
|
||||
self.Bind(wx.EVT_KEY_UP, self.kbEvent)
|
||||
|
||||
self.droneView = gui.builtinAdditionPanes.droneView.DroneView
|
||||
|
||||
if "__WXGTK__" in wx.PlatformInfo:
|
||||
self.Bind(wx.EVT_RIGHT_UP, self.scheduleMenu)
|
||||
else:
|
||||
self.Bind(wx.EVT_RIGHT_DOWN, self.scheduleMenu)
|
||||
self.Bind(wx.EVT_CONTEXT_MENU, self.spawnMenu)
|
||||
|
||||
self.Bind(wx.EVT_LIST_BEGIN_DRAG, self.startDrag)
|
||||
self.SetDropTarget(ProjectedViewDrop(self.handleListDrag))
|
||||
@@ -271,12 +267,7 @@ class ProjectedView(d.Display):
|
||||
sFit.toggleProjected(fitID, item, "right" if event.Button == 3 else "left")
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||
|
||||
def scheduleMenu(self, event):
|
||||
event.Skip()
|
||||
if self.getColumn(event.Position) != self.getColIndex(State):
|
||||
wx.CallAfter(self.spawnMenu)
|
||||
|
||||
def spawnMenu(self):
|
||||
def spawnMenu(self, event):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
if fitID is None:
|
||||
return
|
||||
|
||||
@@ -65,13 +65,10 @@ class ItemAffectedBy(wx.Panel):
|
||||
self.SetSizer(mainSizer)
|
||||
self.PopulateTree()
|
||||
self.Layout()
|
||||
self.affectedBy.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK, self.scheduleMenu)
|
||||
self.affectedBy.Bind(wx.EVT_CONTEXT_MENU, self.spawnMenu)
|
||||
|
||||
def scheduleMenu(self, event):
|
||||
event.Skip()
|
||||
wx.CallAfter(self.spawnMenu, event.Item)
|
||||
|
||||
def spawnMenu(self, item):
|
||||
def spawnMenu(self, event):
|
||||
item, _ = self.affectedBy.HitTest(self.ScreenToClient(event.Position))
|
||||
self.affectedBy.SelectItem(item)
|
||||
|
||||
stuff = self.affectedBy.GetItemData(item)
|
||||
|
||||
@@ -266,12 +266,16 @@ class ItemParams(wx.Panel):
|
||||
info = self.attrInfo.get(attr)
|
||||
att = self.attrValues[attr]
|
||||
|
||||
# If we're working with a stuff object, we should get the original value from our getBaseAttrValue function,
|
||||
# If we're working with a stuff object, we should get the original value from our getItemBaseAttrValue function,
|
||||
# which will return the value with respect to the effective base (with mutators / overrides in place)
|
||||
valDefault = getattr(info, "value", None) # Get default value from attribute
|
||||
if self.stuff is not None:
|
||||
# if it's a stuff, overwrite default (with fallback to current value)
|
||||
valDefault = self.stuff.getBaseAttrValue(attr, valDefault)
|
||||
if self.stuff.item == self.item:
|
||||
valDefault = self.stuff.getItemBaseAttrValue(attr, valDefault)
|
||||
elif self.stuff.charge == self.item:
|
||||
valDefault = self.stuff.getChargeBaseAttrValue(attr, valDefault)
|
||||
|
||||
valueDefault = valDefault if valDefault is not None else att
|
||||
|
||||
val = getattr(att, "value", None)
|
||||
|
||||
@@ -123,7 +123,6 @@ class MiningYieldViewFull(StatsView):
|
||||
# Get the TogglePanel
|
||||
tp = self.panel.GetParent()
|
||||
# Bind the new panel's children to allow context menu access
|
||||
self.parent.applyBinding(self.parent, tp.content_panel)
|
||||
tp.SetLabel(view.getHeaderText(fit))
|
||||
view.refreshPanel(fit)
|
||||
|
||||
|
||||
@@ -153,10 +153,7 @@ class FittingView(d.Display):
|
||||
|
||||
self.Bind(wx.EVT_LEFT_DCLICK, self.removeItem)
|
||||
self.Bind(wx.EVT_LIST_BEGIN_DRAG, self.startDrag)
|
||||
if "__WXGTK__" in wx.PlatformInfo:
|
||||
self.Bind(wx.EVT_RIGHT_UP, self.scheduleMenu)
|
||||
else:
|
||||
self.Bind(wx.EVT_RIGHT_DOWN, self.scheduleMenu)
|
||||
self.Bind(wx.EVT_CONTEXT_MENU, self.spawnMenu)
|
||||
|
||||
self.SetDropTarget(FittingViewDrop(self.handleListDrag))
|
||||
self.activeFitID = None
|
||||
@@ -535,13 +532,8 @@ class FittingView(d.Display):
|
||||
finally:
|
||||
event.Skip()
|
||||
|
||||
def scheduleMenu(self, event):
|
||||
event.Skip()
|
||||
if self.getColumn(event.Position) != self.getColIndex(State):
|
||||
wx.CallAfter(self.spawnMenu)
|
||||
|
||||
def spawnMenu(self):
|
||||
if self.activeFitID is None:
|
||||
def spawnMenu(self, event):
|
||||
if self.activeFitID is None or self.getColumn(self.ScreenToClient(event.Position)) == self.getColIndex(State):
|
||||
return
|
||||
|
||||
sMkt = Market.getInstance()
|
||||
@@ -597,6 +589,7 @@ class FittingView(d.Display):
|
||||
and we have clicked the State column, iterate through the selections and
|
||||
change State
|
||||
"""
|
||||
|
||||
row, _, col = self.HitTestSubItem(event.Position)
|
||||
|
||||
# only do State column and ignore invalid rows
|
||||
|
||||
@@ -373,7 +373,7 @@ class SkillTreeView(wx.Panel):
|
||||
|
||||
tree.Bind(wx.dataview.EVT_TREELIST_ITEM_ACTIVATED, self.expand)
|
||||
tree.Bind(wx.dataview.EVT_TREELIST_ITEM_EXPANDING, self.expandLookup)
|
||||
tree.Bind(wx.dataview.EVT_TREELIST_ITEM_CONTEXT_MENU, self.scheduleMenu)
|
||||
tree.Bind(wx.dataview.EVT_TREELIST_ITEM_CONTEXT_MENU, self.spawnMenu)
|
||||
|
||||
bSizerButtons = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
@@ -590,11 +590,8 @@ class SkillTreeView(wx.Panel):
|
||||
|
||||
tree.SetItemText(childId, 1, "Level %d" % int(level) if isinstance(level, float) else level)
|
||||
|
||||
def scheduleMenu(self, event):
|
||||
event.Skip()
|
||||
wx.CallAfter(self.spawnMenu, event.GetItem())
|
||||
|
||||
def spawnMenu(self, item):
|
||||
def spawnMenu(self, event):
|
||||
item = event.GetItem()
|
||||
self.skillTreeListCtrl.Select(item)
|
||||
thing = self.skillTreeListCtrl.GetFirstChild(item).IsOk()
|
||||
if thing:
|
||||
@@ -677,10 +674,7 @@ class ImplantEditorView(BaseImplantEditorView):
|
||||
self.determineEnabled()
|
||||
charEditor.Bind(GE.CHAR_CHANGED, self.contextChanged)
|
||||
|
||||
if "__WXGTK__" in wx.PlatformInfo:
|
||||
self.pluggedImplantsTree.Bind(wx.EVT_RIGHT_UP, self.scheduleMenu)
|
||||
else:
|
||||
self.pluggedImplantsTree.Bind(wx.EVT_RIGHT_DOWN, self.scheduleMenu)
|
||||
self.pluggedImplantsTree.Bind(wx.EVT_CONTEXT_MENU, self.spawnMenu)
|
||||
|
||||
def bindContext(self):
|
||||
self.Parent.Parent.entityEditor.Bind(wx.EVT_CHOICE, self.contextChanged)
|
||||
@@ -707,11 +701,7 @@ class ImplantEditorView(BaseImplantEditorView):
|
||||
|
||||
sChar.removeImplant(char.ID, implant)
|
||||
|
||||
def scheduleMenu(self, event):
|
||||
event.Skip()
|
||||
wx.CallAfter(self.spawnMenu)
|
||||
|
||||
def spawnMenu(self):
|
||||
def spawnMenu(self, event):
|
||||
context = (("implantEditor",),)
|
||||
# fuck good coding practices, passing a pointer to the character editor here for [reasons] =D
|
||||
# (see implantSets context class for info)
|
||||
|
||||
@@ -25,6 +25,9 @@ class FitImportMutatedCommand(wx.Command):
|
||||
def Do(self):
|
||||
sFit = Fit.getInstance()
|
||||
fitID = self.fitID
|
||||
if fitID is None:
|
||||
return False
|
||||
|
||||
fit = eos.db.getFit(fitID)
|
||||
|
||||
if self.baseItem is None:
|
||||
|
||||
@@ -114,9 +114,7 @@ class StatsPane(wx.Panel):
|
||||
tp.SetLabel(view.getHeaderText(None))
|
||||
view.refreshPanel(None)
|
||||
|
||||
contentPanel.Bind(wx.EVT_RIGHT_DOWN, self.contextHandler(contentPanel))
|
||||
for child in contentPanel.GetChildren():
|
||||
child.Bind(wx.EVT_RIGHT_DOWN, self.contextHandler(contentPanel))
|
||||
contentPanel.Bind(wx.EVT_CONTEXT_MENU, self.contextHandler(contentPanel))
|
||||
|
||||
mainSizer.Add(tp, 0, wx.EXPAND | wx.LEFT, 3)
|
||||
if i < maxviews - 1:
|
||||
@@ -143,9 +141,3 @@ class StatsPane(wx.Panel):
|
||||
event.Skip()
|
||||
|
||||
return handler
|
||||
|
||||
@staticmethod
|
||||
def applyBinding(self, contentPanel):
|
||||
pyfalog.debug("Attempt applyBinding to children of {0}", contentPanel.viewName)
|
||||
for child in contentPanel.GetChildren():
|
||||
child.Bind(wx.EVT_RIGHT_DOWN, self.contextHandler(contentPanel))
|
||||
|
||||
@@ -10,7 +10,7 @@ import os
|
||||
|
||||
|
||||
with open("version.yml", 'r+') as file:
|
||||
data = yaml.load(file, Loader=yaml.FullLoader)
|
||||
data = yaml.load(file, Loader=yaml.SafeLoader)
|
||||
file.seek(0)
|
||||
file.truncate()
|
||||
# todo: run Version() on the tag to ensure that it's of proper formatting - fail a test if not and prevent building
|
||||
|
||||
@@ -10,7 +10,7 @@ import json
|
||||
iconDict = {}
|
||||
|
||||
stream = open('iconIDs.yaml', 'r')
|
||||
docs = yaml.load_all(stream, Loader=yaml.FullLoader)
|
||||
docs = yaml.load_all(stream, Loader=yaml.SafeLoader)
|
||||
|
||||
for doc in docs:
|
||||
for k,v in list(doc.items()):
|
||||
|
||||
@@ -43,9 +43,9 @@ class JargonLoader(object):
|
||||
self.jargon_mtime != self._get_jargon_file_mtime())
|
||||
|
||||
def _load_jargon(self):
|
||||
jargondata = yaml.load(DEFAULT_DATA, Loader=yaml.FullLoader)
|
||||
jargondata = yaml.load(DEFAULT_DATA, Loader=yaml.SafeLoader)
|
||||
with open(JARGON_PATH) as f:
|
||||
userdata = yaml.load(f, Loader=yaml.FullLoader)
|
||||
userdata = yaml.load(f, Loader=yaml.SafeLoader)
|
||||
jargondata.update(userdata)
|
||||
self.jargon_mtime = self._get_jargon_file_mtime()
|
||||
self._jargon = Jargon(jargondata)
|
||||
@@ -57,7 +57,7 @@ class JargonLoader(object):
|
||||
|
||||
@staticmethod
|
||||
def init_user_jargon(jargon_path):
|
||||
values = yaml.load(DEFAULT_DATA, Loader=yaml.FullLoader)
|
||||
values = yaml.load(DEFAULT_DATA, Loader=yaml.SafeLoader)
|
||||
|
||||
# Disabled for issue/1533; do not overwrite existing user config
|
||||
# if os.path.exists(jargon_path):
|
||||
|
||||
@@ -523,18 +523,18 @@ class EfsPort:
|
||||
tf.mode = fit.mode
|
||||
preTraitMultipliers = getCurrentMultipliers(tf)
|
||||
for effect in fit.ship.item.effects.values():
|
||||
if effect._Effect__effectModule is not None:
|
||||
if effect.isImplemented:
|
||||
effect.handler(tf, tf.ship, [])
|
||||
# Factor in mode effects for T3 Destroyers
|
||||
if fit.mode is not None:
|
||||
for effect in fit.mode.item.effects.values():
|
||||
if effect._Effect__effectModule is not None:
|
||||
if effect.isImplemented:
|
||||
effect.handler(tf, fit.mode, [])
|
||||
if fit.ship.item.groupID == getGroup("Strategic Cruiser").ID:
|
||||
subSystems = list(filter(lambda mod: mod.slot == FittingSlot.SUBSYSTEM and mod.item, fit.modules))
|
||||
for sub in subSystems:
|
||||
for effect in sub.item.effects.values():
|
||||
if effect._Effect__effectModule is not None:
|
||||
if effect.isImplemented:
|
||||
effect.handler(tf, sub, [])
|
||||
postTraitMultipliers = getCurrentMultipliers(tf)
|
||||
getMaxRatio = lambda dictA, dictB, key: max(map(lambda a, b: b / a, dictA[key], dictB[key]))
|
||||
|
||||
@@ -76,8 +76,7 @@ class Port(object):
|
||||
success = True
|
||||
try:
|
||||
iportuser.on_port_process_start()
|
||||
backedUpFits = Port.exportXml(iportuser,
|
||||
*svcFit.getInstance().getAllFits())
|
||||
backedUpFits = Port.exportXml(svcFit.getInstance().getAllFits(), iportuser)
|
||||
backupFile = open(path, "w", encoding="utf-8")
|
||||
backupFile.write(backedUpFits)
|
||||
backupFile.close()
|
||||
@@ -241,10 +240,11 @@ class Port(object):
|
||||
return "DNA", (cls.importDna(string),)
|
||||
|
||||
# Assume that we import stand-alone abyssal module if all else fails
|
||||
try:
|
||||
return "MutatedItem", (parseMutant(lines),)
|
||||
except:
|
||||
pass
|
||||
if activeFit is not None:
|
||||
try:
|
||||
return "MutatedItem", (parseMutant(lines),)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
# EFT-related methods
|
||||
|
||||
Reference in New Issue
Block a user