Do not activate ADC on fit import as well
This commit is contained in:
@@ -2,7 +2,7 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from gui.fitCommands.helpers import restoreCheckedStates, stateLimit
|
||||
from gui.fitCommands.helpers import restoreCheckedStates, activeStateLimit
|
||||
from service.fit import Fit
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class CalcAddLocalModuleCommand(wx.Command):
|
||||
sFit = Fit.getInstance()
|
||||
fit = sFit.getFit(self.fitID)
|
||||
|
||||
newMod = self.newModInfo.toModule(fallbackState=stateLimit(self.newModInfo.itemID))
|
||||
newMod = self.newModInfo.toModule(fallbackState=activeStateLimit(self.newModInfo.itemID))
|
||||
if newMod is None:
|
||||
return False
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from gui.fitCommands.helpers import ModuleInfo, restoreCheckedStates, stateLimit
|
||||
from gui.fitCommands.helpers import ModuleInfo, restoreCheckedStates, activeStateLimit
|
||||
from service.fit import Fit
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class CalcReplaceLocalModuleCommand(wx.Command):
|
||||
self.oldModInfo = ModuleInfo.fromModule(oldMod)
|
||||
if self.newModInfo == self.oldModInfo:
|
||||
return False
|
||||
newMod = self.newModInfo.toModule(fallbackState=stateLimit(self.newModInfo.itemID))
|
||||
newMod = self.newModInfo.toModule(fallbackState=activeStateLimit(self.newModInfo.itemID))
|
||||
if newMod is None:
|
||||
return False
|
||||
if newMod.slot != oldMod.slot:
|
||||
|
||||
@@ -317,7 +317,7 @@ class CargoInfo:
|
||||
return makeReprStr(self, ['itemID', 'amount'])
|
||||
|
||||
|
||||
def stateLimit(itemIdentity):
|
||||
def activeStateLimit(itemIdentity):
|
||||
item = Market.getInstance().getItem(itemIdentity)
|
||||
if {'moduleBonusAssaultDamageControl', 'moduleBonusIndustrialInvulnerability'}.intersection(item.effects):
|
||||
return FittingModuleState.ONLINE
|
||||
|
||||
@@ -23,6 +23,7 @@ from collections import OrderedDict
|
||||
|
||||
from logbook import Logger
|
||||
|
||||
from eos.const import FittingModuleState, FittingSlot
|
||||
from eos.saveddata.cargo import Cargo
|
||||
from eos.saveddata.citadel import Citadel
|
||||
from eos.saveddata.drone import Drone
|
||||
@@ -30,7 +31,7 @@ from eos.saveddata.fighter import Fighter
|
||||
from eos.saveddata.fit import Fit
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.ship import Ship
|
||||
from eos.const import FittingSlot, FittingModuleState
|
||||
from gui.fitCommands.helpers import activeStateLimit
|
||||
from service.fit import Fit as svcFit
|
||||
from service.market import Market
|
||||
|
||||
@@ -111,7 +112,7 @@ def importDna(string, fitName=None):
|
||||
else:
|
||||
m.owner = f
|
||||
if m.isValidState(FittingModuleState.ACTIVE):
|
||||
m.state = FittingModuleState.ACTIVE
|
||||
m.state = activeStateLimit(m.item)
|
||||
moduleList.append(m)
|
||||
|
||||
# Recalc to get slot numbers correct for T3 cruisers
|
||||
@@ -123,7 +124,7 @@ def importDna(string, fitName=None):
|
||||
if module.fits(f):
|
||||
module.owner = f
|
||||
if module.isValidState(FittingModuleState.ACTIVE):
|
||||
module.state = FittingModuleState.ACTIVE
|
||||
module.state = activeStateLimit(module.item)
|
||||
f.modules.append(module)
|
||||
|
||||
return f
|
||||
|
||||
@@ -22,18 +22,19 @@ import re
|
||||
|
||||
from logbook import Logger
|
||||
|
||||
from eos.const import FittingModuleState, FittingSlot
|
||||
from eos.db.gamedata.queries import getDynamicItem
|
||||
from eos.saveddata.booster import Booster
|
||||
from eos.saveddata.cargo import Cargo
|
||||
from eos.saveddata.citadel import Citadel
|
||||
from eos.saveddata.booster import Booster
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.fighter import Fighter
|
||||
from eos.saveddata.fit import Fit
|
||||
from eos.saveddata.implant import Implant
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.ship import Ship
|
||||
from eos.saveddata.fit import Fit
|
||||
from eos.const import FittingSlot, FittingModuleState
|
||||
from service.const import PortEftOptions, PortEftRigSize
|
||||
from gui.fitCommands.helpers import activeStateLimit
|
||||
from service.const import PortEftOptions
|
||||
from service.fit import Fit as svcFit
|
||||
from service.market import Market
|
||||
from service.port.muta import parseMutant, renderMutant
|
||||
@@ -443,7 +444,7 @@ def importEftCfg(shipname, lines, iportuser):
|
||||
m.owner = fitobj
|
||||
# Activate mod if it is activable
|
||||
if m.isValidState(FittingModuleState.ACTIVE):
|
||||
m.state = FittingModuleState.ACTIVE
|
||||
m.state = activeStateLimit(m.item)
|
||||
# Add charge to mod if applicable, on any errors just don't add anything
|
||||
if chargeName:
|
||||
try:
|
||||
@@ -804,7 +805,7 @@ class AbstractFit:
|
||||
if itemSpec.offline and m.isValidState(FittingModuleState.OFFLINE):
|
||||
m.state = FittingModuleState.OFFLINE
|
||||
elif m.isValidState(FittingModuleState.ACTIVE):
|
||||
m.state = FittingModuleState.ACTIVE
|
||||
m.state = activeStateLimit(m.item)
|
||||
return m
|
||||
|
||||
def addImplant(self, itemSpec):
|
||||
|
||||
@@ -23,14 +23,15 @@ import json
|
||||
|
||||
from logbook import Logger
|
||||
|
||||
from eos.const import FittingModuleState, FittingSlot
|
||||
from eos.saveddata.cargo import Cargo
|
||||
from eos.saveddata.citadel import Citadel
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.fighter import Fighter
|
||||
from eos.saveddata.fit import Fit
|
||||
from eos.saveddata.module import Module
|
||||
from eos.const import FittingSlot, FittingModuleState
|
||||
from eos.saveddata.ship import Ship
|
||||
from gui.fitCommands.helpers import activeStateLimit
|
||||
from service.fit import Fit as svcFit
|
||||
from service.market import Market
|
||||
|
||||
@@ -196,7 +197,7 @@ def importESI(string):
|
||||
fitobj.modules.append(m)
|
||||
else:
|
||||
if m.isValidState(FittingModuleState.ACTIVE):
|
||||
m.state = FittingModuleState.ACTIVE
|
||||
m.state = activeStateLimit(m.item)
|
||||
|
||||
moduleList.append(m)
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import xml.parsers.expat
|
||||
|
||||
from logbook import Logger
|
||||
|
||||
from eos.const import FittingModuleState, FittingSlot
|
||||
from eos.saveddata.cargo import Cargo
|
||||
from eos.saveddata.citadel import Citadel
|
||||
from eos.saveddata.drone import Drone
|
||||
@@ -30,12 +31,11 @@ from eos.saveddata.fighter import Fighter
|
||||
from eos.saveddata.fit import Fit
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.ship import Ship
|
||||
from eos.const import FittingSlot, FittingModuleState
|
||||
from gui.fitCommands.helpers import activeStateLimit
|
||||
from service.fit import Fit as svcFit
|
||||
from service.market import Market
|
||||
from utils.strfunctions import sequential_rep, replace_ltgt
|
||||
|
||||
from service.port.shared import IPortUser, processing_notify
|
||||
from utils.strfunctions import replace_ltgt, sequential_rep
|
||||
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
@@ -200,7 +200,7 @@ def importXml(text, iportuser):
|
||||
fitobj.modules.append(m)
|
||||
else:
|
||||
if m.isValidState(FittingModuleState.ACTIVE):
|
||||
m.state = FittingModuleState.ACTIVE
|
||||
m.state = activeStateLimit(m.item)
|
||||
|
||||
moduleList.append(m)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user