Merge branch 'price_optimize' of https://github.com/pyfa-org/Pyfa into price_optimize
This commit is contained in:
@@ -25,7 +25,7 @@ from gui.builtinMarketBrowser.events import ItemSelected, ITEM_SELECTED
|
||||
import gui.mainFrame
|
||||
import gui.display as d
|
||||
from gui.builtinViewColumns.state import State
|
||||
from eos.saveddata.module import Slot
|
||||
from eos.const import FittingSlot
|
||||
from gui.contextMenu import ContextMenu
|
||||
from gui.utils.staticHelpers import DragDropHelper
|
||||
from service.fit import Fit
|
||||
@@ -93,9 +93,9 @@ class FighterView(wx.Panel):
|
||||
if fit:
|
||||
for x in self.labels:
|
||||
if fit.isStructure:
|
||||
slot = getattr(Slot, "FS_{}".format(x.upper()))
|
||||
slot = getattr(FittingSlot, "FS_{}".format(x.upper()))
|
||||
else:
|
||||
slot = getattr(Slot, "F_{}".format(x.upper()))
|
||||
slot = getattr(FittingSlot, "F_{}".format(x.upper()))
|
||||
used = fit.getSlotsUsed(slot)
|
||||
total = fit.getNumSlots(slot)
|
||||
color = wx.Colour(204, 51, 51) if used > total else wx.SystemSettings.GetColour(
|
||||
|
||||
@@ -26,7 +26,7 @@ from gui.builtinViewColumns.state import State
|
||||
from gui.utils.staticHelpers import DragDropHelper
|
||||
from gui.contextMenu import ContextMenu
|
||||
import gui.globalEvents as GE
|
||||
from eos.saveddata.fit import ImplantLocation
|
||||
from eos.const import ImplantLocation
|
||||
from service.fit import Fit
|
||||
from service.market import Market
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
@@ -5,7 +5,7 @@ import wx
|
||||
|
||||
import gui.fitCommands as cmd
|
||||
import gui.mainFrame
|
||||
from eos.saveddata.module import Hardpoint
|
||||
from eos.const import FittingHardpoint
|
||||
from gui.bitmap_loader import BitmapLoader
|
||||
from gui.contextMenu import ContextMenu
|
||||
from service.market import Market
|
||||
@@ -136,7 +136,7 @@ class ModuleAmmoPicker(ContextMenu):
|
||||
hardpoint = self.module.hardpoint
|
||||
moduleName = self.module.item.name
|
||||
# Make sure we do not consider mining turrets as combat turrets
|
||||
if hardpoint == Hardpoint.TURRET and self.module.getModifiedItemAttr("miningAmount", None) is None:
|
||||
if hardpoint == FittingHardpoint.TURRET and self.module.getModifiedItemAttr("miningAmount", None) is None:
|
||||
self.addSeperator(m, "Long Range")
|
||||
items = []
|
||||
range_ = None
|
||||
@@ -180,7 +180,7 @@ class ModuleAmmoPicker(ContextMenu):
|
||||
m.Append(item)
|
||||
|
||||
self.addSeperator(m, "Short Range")
|
||||
elif hardpoint == Hardpoint.MISSILE and moduleName != 'Festival Launcher':
|
||||
elif hardpoint == FittingHardpoint.MISSILE and moduleName != 'Festival Launcher':
|
||||
self.charges.sort(key=self.missileSorter)
|
||||
type_ = None
|
||||
sub = None
|
||||
|
||||
@@ -1,22 +1,4 @@
|
||||
from enum import Enum, auto
|
||||
|
||||
|
||||
# Define the various groups of attributes
|
||||
class AttrGroup(Enum):
|
||||
FITTING = auto()
|
||||
STRUCTURE = auto()
|
||||
SHIELD = auto()
|
||||
ARMOR = auto()
|
||||
TARGETING = auto()
|
||||
EWAR_RESISTS = auto()
|
||||
CAPACITOR = auto()
|
||||
SHARED_FACILITIES = auto()
|
||||
FIGHTER_FACILITIES = auto()
|
||||
ON_DEATH = auto()
|
||||
JUMP_SYSTEMS = auto()
|
||||
PROPULSIONS = auto()
|
||||
FIGHTERS = auto()
|
||||
|
||||
from service.const import GuiAttrGroup
|
||||
|
||||
RequiredSkillAttrs = sum((["requiredSkill{}".format(x), "requiredSkill{}Level".format(x)] for x in range(1, 7)), [])
|
||||
|
||||
@@ -45,7 +27,7 @@ for x in AttrGroups:
|
||||
|
||||
# Start defining all the known attribute groups
|
||||
AttrGroupDict = {
|
||||
AttrGroup.FITTING : {
|
||||
GuiAttrGroup.FITTING : {
|
||||
"label" : "Fitting",
|
||||
"attributes": [
|
||||
# parent-level attributes
|
||||
@@ -67,7 +49,7 @@ AttrGroupDict = {
|
||||
# "mass",
|
||||
]
|
||||
},
|
||||
AttrGroup.STRUCTURE : {
|
||||
GuiAttrGroup.STRUCTURE : {
|
||||
"label" : "Structure",
|
||||
"attributes": [
|
||||
"hp",
|
||||
@@ -97,7 +79,7 @@ AttrGroupDict = {
|
||||
"explosiveDamageResonance"
|
||||
]
|
||||
},
|
||||
AttrGroup.ARMOR : {
|
||||
GuiAttrGroup.ARMOR : {
|
||||
"label": "Armor",
|
||||
"attributes":[
|
||||
"armorHP",
|
||||
@@ -109,7 +91,7 @@ AttrGroupDict = {
|
||||
]
|
||||
|
||||
},
|
||||
AttrGroup.SHIELD : {
|
||||
GuiAttrGroup.SHIELD : {
|
||||
"label": "Shield",
|
||||
"attributes": [
|
||||
"shieldCapacity",
|
||||
@@ -122,7 +104,7 @@ AttrGroupDict = {
|
||||
]
|
||||
|
||||
},
|
||||
AttrGroup.EWAR_RESISTS : {
|
||||
GuiAttrGroup.EWAR_RESISTS : {
|
||||
"label": "Electronic Warfare",
|
||||
"attributes": [
|
||||
"ECMResistance",
|
||||
@@ -135,14 +117,14 @@ AttrGroupDict = {
|
||||
"weaponDisruptionResistance",
|
||||
]
|
||||
},
|
||||
AttrGroup.CAPACITOR : {
|
||||
GuiAttrGroup.CAPACITOR : {
|
||||
"label": "Capacitor",
|
||||
"attributes": [
|
||||
"capacitorCapacity",
|
||||
"rechargeRate",
|
||||
]
|
||||
},
|
||||
AttrGroup.TARGETING : {
|
||||
GuiAttrGroup.TARGETING : {
|
||||
"label": "Targeting",
|
||||
"attributes": [
|
||||
"maxTargetRange",
|
||||
@@ -160,7 +142,7 @@ AttrGroupDict = {
|
||||
"scanLadarStrength",
|
||||
]
|
||||
},
|
||||
AttrGroup.SHARED_FACILITIES : {
|
||||
GuiAttrGroup.SHARED_FACILITIES : {
|
||||
"label" : "Shared Facilities",
|
||||
"attributes": [
|
||||
"fleetHangarCapacity",
|
||||
@@ -168,7 +150,7 @@ AttrGroupDict = {
|
||||
"maxJumpClones",
|
||||
]
|
||||
},
|
||||
AttrGroup.FIGHTER_FACILITIES: {
|
||||
GuiAttrGroup.FIGHTER_FACILITIES: {
|
||||
"label": "Fighter Squadron Facilities",
|
||||
"attributes": [
|
||||
"fighterCapacity",
|
||||
@@ -181,7 +163,7 @@ AttrGroupDict = {
|
||||
"fighterStandupHeavySlots",
|
||||
]
|
||||
},
|
||||
AttrGroup.ON_DEATH : {
|
||||
GuiAttrGroup.ON_DEATH : {
|
||||
"label": "On Death",
|
||||
"attributes": [
|
||||
"onDeathDamageEM",
|
||||
@@ -192,7 +174,7 @@ AttrGroupDict = {
|
||||
"onDeathSignatureRadius",
|
||||
]
|
||||
},
|
||||
AttrGroup.JUMP_SYSTEMS : {
|
||||
GuiAttrGroup.JUMP_SYSTEMS : {
|
||||
"label": "Jump Drive Systems",
|
||||
"attributes": [
|
||||
"jumpDriveCapacitorNeed",
|
||||
@@ -206,13 +188,13 @@ AttrGroupDict = {
|
||||
"jumpPortalDuration",
|
||||
]
|
||||
},
|
||||
AttrGroup.PROPULSIONS : {
|
||||
GuiAttrGroup.PROPULSIONS : {
|
||||
"label": "Propulsion",
|
||||
"attributes": [
|
||||
"maxVelocity"
|
||||
]
|
||||
},
|
||||
AttrGroup.FIGHTERS : {
|
||||
GuiAttrGroup.FIGHTERS : {
|
||||
"label": "Fighter",
|
||||
"attributes": [
|
||||
"mass",
|
||||
@@ -228,25 +210,25 @@ AttrGroupDict = {
|
||||
}
|
||||
|
||||
Group1 = [
|
||||
AttrGroup.FITTING,
|
||||
AttrGroup.STRUCTURE,
|
||||
AttrGroup.ARMOR,
|
||||
AttrGroup.SHIELD,
|
||||
AttrGroup.EWAR_RESISTS,
|
||||
AttrGroup.CAPACITOR,
|
||||
AttrGroup.TARGETING,
|
||||
AttrGroup.SHARED_FACILITIES,
|
||||
AttrGroup.FIGHTER_FACILITIES,
|
||||
AttrGroup.ON_DEATH,
|
||||
AttrGroup.JUMP_SYSTEMS,
|
||||
AttrGroup.PROPULSIONS,
|
||||
GuiAttrGroup.FITTING,
|
||||
GuiAttrGroup.STRUCTURE,
|
||||
GuiAttrGroup.ARMOR,
|
||||
GuiAttrGroup.SHIELD,
|
||||
GuiAttrGroup.EWAR_RESISTS,
|
||||
GuiAttrGroup.CAPACITOR,
|
||||
GuiAttrGroup.TARGETING,
|
||||
GuiAttrGroup.SHARED_FACILITIES,
|
||||
GuiAttrGroup.FIGHTER_FACILITIES,
|
||||
GuiAttrGroup.ON_DEATH,
|
||||
GuiAttrGroup.JUMP_SYSTEMS,
|
||||
GuiAttrGroup.PROPULSIONS,
|
||||
]
|
||||
|
||||
CategoryGroups = {
|
||||
"Fighter" : [
|
||||
AttrGroup.FIGHTERS,
|
||||
AttrGroup.SHIELD,
|
||||
AttrGroup.TARGETING,
|
||||
GuiAttrGroup.FIGHTERS,
|
||||
GuiAttrGroup.SHIELD,
|
||||
GuiAttrGroup.TARGETING,
|
||||
],
|
||||
"Ship" : Group1,
|
||||
"Drone" : Group1,
|
||||
|
||||
@@ -4,12 +4,12 @@ import config
|
||||
# noinspection PyPackageRequirements
|
||||
import wx
|
||||
import wx.lib.agw.hypertreelist
|
||||
from gui.builtinItemStatsViews.helpers import AutoListCtrl
|
||||
|
||||
from gui.bitmap_loader import BitmapLoader
|
||||
from gui.utils.numberFormatter import formatAmount, roundDec
|
||||
from enum import IntEnum
|
||||
from gui.builtinItemStatsViews.attributeGrouping import *
|
||||
from service.const import GuiAttrGroup
|
||||
|
||||
|
||||
class AttributeView(IntEnum):
|
||||
@@ -205,7 +205,7 @@ class ItemParams(wx.Panel):
|
||||
misc_parent = root
|
||||
|
||||
# We must first deet4ermine if it's categorey already has defined groupings set for it. Otherwise, we default to just using the fitting group
|
||||
order = CategoryGroups.get(self.item.category.categoryName, [AttrGroup.FITTING])
|
||||
order = CategoryGroups.get(self.item.category.categoryName, [GuiAttrGroup.FITTING])
|
||||
# start building out the tree
|
||||
for data in [AttrGroupDict[o] for o in order]:
|
||||
heading = data.get("label")
|
||||
|
||||
@@ -26,7 +26,7 @@ import gui.mainFrame
|
||||
from gui.chrome_tabs import EVT_NOTEBOOK_PAGE_CHANGED
|
||||
from gui.utils import fonts
|
||||
|
||||
from eos.saveddata.module import Hardpoint
|
||||
from eos.const import FittingHardpoint
|
||||
|
||||
from gui.utils.numberFormatter import formatAmount
|
||||
|
||||
@@ -196,9 +196,9 @@ class ResourcesViewFull(StatsView):
|
||||
# If we did anything intresting, we'd update our labels to reflect the new fit's stats here
|
||||
|
||||
stats = (
|
||||
("label%sUsedTurretHardpoints", lambda: fit.getHardpointsUsed(Hardpoint.TURRET), 0, 0, 0),
|
||||
("label%sUsedTurretHardpoints", lambda: fit.getHardpointsUsed(FittingHardpoint.TURRET), 0, 0, 0),
|
||||
("label%sTotalTurretHardpoints", lambda: fit.ship.getModifiedItemAttr('turretSlotsLeft'), 0, 0, 0),
|
||||
("label%sUsedLauncherHardpoints", lambda: fit.getHardpointsUsed(Hardpoint.MISSILE), 0, 0, 0),
|
||||
("label%sUsedLauncherHardpoints", lambda: fit.getHardpointsUsed(FittingHardpoint.MISSILE), 0, 0, 0),
|
||||
("label%sTotalLauncherHardpoints", lambda: fit.ship.getModifiedItemAttr('launcherSlotsLeft'), 0, 0, 0),
|
||||
("label%sUsedDronesActive", lambda: fit.activeDrones, 0, 0, 0),
|
||||
("label%sTotalDronesActive", lambda: fit.extraAttributes["maxActiveDrones"], 0, 0, 0),
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
import wx
|
||||
from eos.saveddata.implant import Implant
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.module import Module, Slot, Rack
|
||||
from eos.saveddata.module import Module, Rack
|
||||
from eos.saveddata.fit import Fit
|
||||
from eos.const import FittingSlot
|
||||
from gui.viewColumn import ViewColumn
|
||||
|
||||
|
||||
@@ -32,7 +33,7 @@ class BaseIcon(ViewColumn):
|
||||
return self.shipImage
|
||||
elif isinstance(stuff, Module):
|
||||
if stuff.isEmpty:
|
||||
return self.fittingView.imageList.GetImageIndex("slot_%s_small" % Slot.getName(stuff.slot).lower(),
|
||||
return self.fittingView.imageList.GetImageIndex("slot_%s_small" % FittingSlot(stuff.slot).name.lower(),
|
||||
"gui")
|
||||
else:
|
||||
return self.loadIconFile(stuff.item.iconID or "")
|
||||
|
||||
@@ -25,8 +25,9 @@ from eos.saveddata.cargo import Cargo
|
||||
from eos.saveddata.implant import Implant
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.fighter import Fighter
|
||||
from eos.saveddata.module import Module, Slot, Rack
|
||||
from eos.saveddata.module import Module, Rack
|
||||
from eos.saveddata.fit import Fit
|
||||
from eos.const import FittingSlot
|
||||
from service.fit import Fit as FitSvc
|
||||
from service.market import Market
|
||||
from gui.viewColumn import ViewColumn
|
||||
@@ -72,10 +73,10 @@ class BaseName(ViewColumn):
|
||||
return "%s (%s)" % (stuff.name, stuff.ship.item.name)
|
||||
elif isinstance(stuff, Rack):
|
||||
if FitSvc.getInstance().serviceFittingOptions["rackLabels"]:
|
||||
if stuff.slot == Slot.MODE:
|
||||
if stuff.slot == FittingSlot.MODE:
|
||||
return '─ Tactical Mode ─'
|
||||
else:
|
||||
return '─ {} {} Slot{}─'.format(stuff.num, Slot.getName(stuff.slot).capitalize(), '' if stuff.num == 1 else 's')
|
||||
return '─ {} {} Slot{}─'.format(stuff.num, FittingSlot(stuff.slot).name.capitalize(), '' if stuff.num == 1 else 's')
|
||||
else:
|
||||
return ""
|
||||
elif isinstance(stuff, Module):
|
||||
@@ -89,7 +90,7 @@ class BaseName(ViewColumn):
|
||||
return "{} {}".format(type.name, stuff.item.name[-1:])
|
||||
|
||||
if stuff.isEmpty:
|
||||
return "%s Slot" % Slot.getName(stuff.slot).capitalize()
|
||||
return "%s Slot" % FittingSlot(stuff.slot).name.capitalize()
|
||||
else:
|
||||
return stuff.item.name
|
||||
elif isinstance(stuff, Implant):
|
||||
|
||||
@@ -24,7 +24,8 @@ import wx
|
||||
from eos.saveddata.fit import Fit
|
||||
from eos.saveddata.implant import Implant
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.module import Module, State as State_, Rack
|
||||
from eos.saveddata.module import Module, Rack
|
||||
from eos.const import FittingModuleState as State_
|
||||
from gui.viewColumn import ViewColumn
|
||||
|
||||
import gui.mainFrame
|
||||
@@ -46,12 +47,11 @@ class State(ViewColumn):
|
||||
|
||||
def getToolTip(self, mod):
|
||||
if isinstance(mod, Module) and not mod.isEmpty:
|
||||
return State_.getName(mod.state).title()
|
||||
return State_(mod.state).name.title()
|
||||
|
||||
def getImageId(self, stuff):
|
||||
generic_active = self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(1).lower(), "gui")
|
||||
generic_inactive = self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(-1).lower(),
|
||||
"gui")
|
||||
generic_active = self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.ACTIVE.name.lower(), "gui")
|
||||
generic_inactive = self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.OFFLINE.name.lower(), "gui")
|
||||
|
||||
if isinstance(stuff, Drone):
|
||||
if stuff.amountActive > 0:
|
||||
@@ -64,7 +64,7 @@ class State(ViewColumn):
|
||||
if stuff.isEmpty:
|
||||
return -1
|
||||
else:
|
||||
return self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(stuff.state).lower(),
|
||||
return self.fittingView.imageList.GetImageIndex("state_%s_small" % State_(stuff.state).name.lower(),
|
||||
"gui")
|
||||
elif isinstance(stuff, Fit):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -83,7 +83,7 @@ class State(ViewColumn):
|
||||
return generic_inactive
|
||||
elif isinstance(stuff, Implant) and stuff.character:
|
||||
# if we're showing character implants, show an "online" state, which should not be changed
|
||||
return self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(0).lower(), "gui")
|
||||
return self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.ONLINE.name.lower(), "gui")
|
||||
else:
|
||||
active = getattr(stuff, "active", None)
|
||||
if active is None:
|
||||
|
||||
@@ -30,7 +30,8 @@ import gui.globalEvents as GE
|
||||
import gui.mainFrame
|
||||
import gui.multiSwitch
|
||||
from eos.saveddata.mode import Mode
|
||||
from eos.saveddata.module import Module, Rack, Slot
|
||||
from eos.saveddata.module import Module, Rack
|
||||
from eos.const import FittingSlot
|
||||
from gui.bitmap_loader import BitmapLoader
|
||||
from gui.builtinMarketBrowser.events import ITEM_SELECTED
|
||||
from gui.builtinShipBrowser.events import EVT_FIT_REMOVED, EVT_FIT_RENAMED, EVT_FIT_SELECTED, FitSelected
|
||||
@@ -474,7 +475,14 @@ class FittingView(d.Display):
|
||||
sFit = Fit.getInstance()
|
||||
fit = sFit.getFit(self.activeFitID)
|
||||
|
||||
slotOrder = [Slot.SUBSYSTEM, Slot.HIGH, Slot.MED, Slot.LOW, Slot.RIG, Slot.SERVICE]
|
||||
slotOrder = [
|
||||
FittingSlot.SUBSYSTEM,
|
||||
FittingSlot.HIGH,
|
||||
FittingSlot.MED,
|
||||
FittingSlot.LOW,
|
||||
FittingSlot.RIG,
|
||||
FittingSlot.SERVICE
|
||||
]
|
||||
|
||||
if fit is not None:
|
||||
self.mods = fit.modules[:]
|
||||
@@ -507,7 +515,7 @@ class FittingView(d.Display):
|
||||
# while also marking the mode header position in the Blanks list
|
||||
if sFit.serviceFittingOptions["rackSlots"]:
|
||||
self.blanks.append(len(self.mods))
|
||||
self.mods.append(Rack.buildRack(Slot.MODE, None))
|
||||
self.mods.append(Rack.buildRack(FittingSlot.MODE, None))
|
||||
|
||||
self.mods.append(fit.mode)
|
||||
else:
|
||||
@@ -648,8 +656,7 @@ class FittingView(d.Display):
|
||||
slotMap = {}
|
||||
|
||||
# test for too many modules (happens with t3s / CCP change in slot layout)
|
||||
for slotType in Slot.getTypes():
|
||||
slot = Slot.getValue(slotType)
|
||||
for slot in [e.value for e in FittingSlot]:
|
||||
slotMap[slot] = fit.getSlotsFree(slot) < 0
|
||||
|
||||
for i, mod in enumerate(self.mods):
|
||||
@@ -735,8 +742,8 @@ class FittingView(d.Display):
|
||||
return
|
||||
|
||||
slotMap = {}
|
||||
for slotType in Slot.getTypes():
|
||||
slot = Slot.getValue(slotType)
|
||||
|
||||
for slot in [e.value for e in FittingSlot]:
|
||||
slotMap[slot] = fit.getSlotsFree(slot) < 0
|
||||
|
||||
padding = 2
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import wx
|
||||
from eos.saveddata.module import Module, State
|
||||
from eos.saveddata.module import Module
|
||||
from eos.const import FittingModuleState
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
from service.fit import Fit
|
||||
@@ -52,8 +53,8 @@ class FitAddModuleCommand(wx.Command):
|
||||
self.module.owner = fit
|
||||
numSlots = len(fit.modules)
|
||||
fit.modules.append(self.module)
|
||||
if self.module.isValidState(State.ACTIVE):
|
||||
self.module.state = State.ACTIVE
|
||||
if self.module.isValidState(FittingModuleState.ACTIVE):
|
||||
self.module.state = FittingModuleState.ACTIVE
|
||||
|
||||
# todo: fix these
|
||||
# As some items may affect state-limiting attributes of the ship, calculate new attributes first
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import wx
|
||||
from eos.saveddata.module import Module, State
|
||||
from eos.saveddata.module import Module
|
||||
from eos.const import FittingModuleState
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
@@ -28,7 +29,7 @@ class FitAddProjectedEnvCommand(wx.Command):
|
||||
|
||||
# todo: thing to check for existing environmental effects
|
||||
|
||||
module.state = State.ONLINE
|
||||
module.state = FittingModuleState.ONLINE
|
||||
if module.isExclusiveSystemEffect:
|
||||
# if this is an exclusive system effect, we need to cache the old one. We make room for the new one here, which returns the old one
|
||||
self.old_item = fit.projectedModules.makeRoom(module)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import wx
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
from eos.saveddata.module import Module, State
|
||||
from eos.saveddata.module import Module
|
||||
from eos.const import FittingModuleState
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
@@ -27,9 +28,9 @@ class FitAddProjectedModuleCommand(wx.Command):
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
module.state = State.ACTIVE
|
||||
module.state = FittingModuleState.ACTIVE
|
||||
if not module.canHaveState(module.state, fit):
|
||||
module.state = State.OFFLINE
|
||||
module.state = FittingModuleState.OFFLINE
|
||||
fit.projectedModules.append(module)
|
||||
|
||||
eos.db.commit()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import wx
|
||||
from eos.saveddata.module import Module, State
|
||||
from eos.saveddata.module import Module
|
||||
from eos.const import FittingModuleState
|
||||
import eos.db
|
||||
from eos.db.gamedata.queries import getDynamicItem
|
||||
from logbook import Logger
|
||||
@@ -62,8 +63,8 @@ class FitImportMutatedCommand(wx.Command):
|
||||
module.owner = fit
|
||||
numSlots = len(fit.modules)
|
||||
fit.modules.append(module)
|
||||
if module.isValidState(State.ACTIVE):
|
||||
module.state = State.ACTIVE
|
||||
if module.isValidState(FittingModuleState.ACTIVE):
|
||||
module.state = FittingModuleState.ACTIVE
|
||||
|
||||
# todo: fix these
|
||||
# As some items may affect state-limiting attributes of the ship, calculate new attributes first
|
||||
|
||||
@@ -2,7 +2,8 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.saveddata.module import Module, State
|
||||
from eos.saveddata.module import Module
|
||||
from eos.const import FittingModuleState
|
||||
from gui.fitCommands.helpers import ModuleInfoCache
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
@@ -75,8 +76,8 @@ class FitReplaceModuleCommand(wx.Command):
|
||||
if self.module.fits(fit):
|
||||
self.module.owner = fit
|
||||
fit.modules.toModule(self.position, self.module)
|
||||
if self.module.isValidState(State.ACTIVE):
|
||||
self.module.state = State.ACTIVE
|
||||
if self.module.isValidState(FittingModuleState.ACTIVE):
|
||||
self.module.state = FittingModuleState.ACTIVE
|
||||
|
||||
if self.old_module and self.old_module.charge and self.module.isValidCharge(self.old_module.charge):
|
||||
self.module.charge = self.old_module.charge
|
||||
|
||||
@@ -3,7 +3,7 @@ from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from eos.saveddata.fit import ImplantLocation
|
||||
from eos.const import ImplantLocation
|
||||
from .calc.fitAddImplant import FitAddImplantCommand
|
||||
from .calc.fitChangeImplantLocation import FitChangeImplantLocation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user