Changed FittingSlot to IntEnum
This commit is contained in:
@@ -25,7 +25,8 @@ 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 FittingSlot
|
||||
#from eos.saveddata.module import FittingSlot
|
||||
from eos.const import FittingSlot
|
||||
from gui.contextMenu import ContextMenu
|
||||
from gui.utils.staticHelpers import DragDropHelper
|
||||
from service.fit import Fit
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
import wx
|
||||
from eos.saveddata.implant import Implant
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.module import Module, FittingSlot, 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" % FittingSlot.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, FittingSlot, 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
|
||||
@@ -75,7 +76,7 @@ class BaseName(ViewColumn):
|
||||
if stuff.slot == FittingSlot.MODE:
|
||||
return '─ Tactical Mode ─'
|
||||
else:
|
||||
return '─ {} {} Slot{}─'.format(stuff.num, FittingSlot.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" % FittingSlot.getName(stuff.slot).capitalize()
|
||||
return "%s Slot" % FittingSlot(stuff.slot).name.capitalize()
|
||||
else:
|
||||
return stuff.item.name
|
||||
elif isinstance(stuff, Implant):
|
||||
|
||||
@@ -46,7 +46,7 @@ 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_(1).name.lower(), "gui")
|
||||
|
||||
@@ -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, FittingSlot
|
||||
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
|
||||
@@ -648,8 +649,7 @@ class FittingView(d.Display):
|
||||
slotMap = {}
|
||||
|
||||
# test for too many modules (happens with t3s / CCP change in slot layout)
|
||||
for slotType in FittingSlot.getTypes():
|
||||
slot = FittingSlot.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 +735,8 @@ class FittingView(d.Display):
|
||||
return
|
||||
|
||||
slotMap = {}
|
||||
for slotType in FittingSlot.getTypes():
|
||||
slot = FittingSlot.getValue(slotType)
|
||||
|
||||
for slot in [e.value for e in FittingSlot]:
|
||||
slotMap[slot] = fit.getSlotsFree(slot) < 0
|
||||
|
||||
padding = 2
|
||||
|
||||
Reference in New Issue
Block a user