Use some new stuff in eos meaning we don't have to do any effort to get names of
constants in enums
This commit is contained in:
2
eos
2
eos
Submodule eos updated: 47b9dcef3a...9466cb9799
@@ -27,23 +27,16 @@ class ModuleNameOrSlot(ViewColumn):
|
||||
def __init__(self, fittingView, params):
|
||||
ViewColumn.__init__(self, fittingView)
|
||||
self.columnText = "Name"
|
||||
self.slotNameMap = {}
|
||||
for slot in Slot.__dict__:
|
||||
if slot[0:2] == "__":
|
||||
continue
|
||||
|
||||
id = Slot.__dict__[slot]
|
||||
self.slotNameMap[id] = slot.lower()
|
||||
|
||||
def getText(self, mod):
|
||||
if mod.isEmpty:
|
||||
return "%s Slot" % self.slotNameMap[mod.slot].capitalize()
|
||||
return "%s Slot" % Slot.getName(mod.slot).capitalize()
|
||||
else:
|
||||
return mod.item.name
|
||||
|
||||
def getImageId(self, mod):
|
||||
if mod.isEmpty:
|
||||
bitmap = bitmapLoader.getBitmap("slot_%s_small" % self.slotNameMap[mod.slot], "icons")
|
||||
bitmap = bitmapLoader.getBitmap("slot_%s_small" % Slot.getName(mod.slot).lower(), "icons")
|
||||
iconId = self.fittingView.imageList.Add(bitmap)
|
||||
else:
|
||||
iconFile = mod.item.icon.iconFile if mod.item.icon else ""
|
||||
|
||||
@@ -29,12 +29,6 @@ class ModuleState(ViewColumn):
|
||||
self.resizable = False
|
||||
self.size = 20
|
||||
self.stateNameMap = {}
|
||||
for state in State.__dict__:
|
||||
if state[0:2] == "__":
|
||||
continue
|
||||
|
||||
id = State.__dict__[state]
|
||||
self.stateNameMap[id] = state.lower()
|
||||
|
||||
def getText(self, mod):
|
||||
return ""
|
||||
@@ -43,7 +37,7 @@ class ModuleState(ViewColumn):
|
||||
if mod.isEmpty:
|
||||
return -1
|
||||
else:
|
||||
bitmap = bitmapLoader.getBitmap("state_%s_small" % self.stateNameMap[mod.state], "icons")
|
||||
bitmap = bitmapLoader.getBitmap("state_%s_small" % State.getName(mod.state).lower(), "icons")
|
||||
return self.fittingView.imageList.Add(bitmap)
|
||||
|
||||
ModuleState.register()
|
||||
|
||||
Reference in New Issue
Block a user