Use short ship names along with fit names
This commit is contained in:
@@ -44,11 +44,12 @@ pyfalog = Logger(__name__)
|
||||
|
||||
class FitLite:
|
||||
|
||||
def __init__(self, id=None, name=None, shipID=None, shipName=None):
|
||||
def __init__(self, id=None, name=None, shipID=None, shipName=None, shipNameShort=None):
|
||||
self.ID = id
|
||||
self.name = name
|
||||
self.shipID = shipID
|
||||
self.shipName = shipName
|
||||
self.shipNameShort = shipNameShort
|
||||
|
||||
def __repr__(self):
|
||||
return 'FitLite(ID={})'.format(self.ID)
|
||||
|
||||
@@ -64,15 +64,15 @@ class BaseName(ViewColumn):
|
||||
info = stuff.getProjectionInfo(fitID)
|
||||
|
||||
if info:
|
||||
return "%dx %s (%s)" % (stuff.getProjectionInfo(fitID).amount, stuff.name, stuff.ship.item.name)
|
||||
return "%dx %s (%s)" % (stuff.getProjectionInfo(fitID).amount, stuff.name, stuff.ship.item.getShortName())
|
||||
|
||||
pyfalog.warning("Projected View trying to display things that aren't there. stuff: {}, info: {}", repr(stuff),
|
||||
info)
|
||||
return "<unknown>"
|
||||
else:
|
||||
return "%s (%s)" % (stuff.name, stuff.ship.item.name)
|
||||
return "%s (%s)" % (stuff.name, stuff.ship.item.getShortName())
|
||||
elif isinstance(stuff, FitLite):
|
||||
return "{} ({})".format(stuff.name, stuff.shipName)
|
||||
return "{} ({})".format(stuff.name, stuff.shipNameShort)
|
||||
elif isinstance(stuff, Rack):
|
||||
if FitSvc.getInstance().serviceFittingOptions["rackLabels"]:
|
||||
if stuff.slot == FittingSlot.MODE:
|
||||
|
||||
@@ -110,10 +110,10 @@ class Fit:
|
||||
for shipID in shipMap:
|
||||
ship = eos.db.getItem(shipID)
|
||||
if ship is not None:
|
||||
shipMap[shipID] = ship.name
|
||||
shipMap[shipID] = (ship.name, ship.getShortName())
|
||||
for fit in fits:
|
||||
try:
|
||||
fit.shipName = shipMap[fit.shipID]
|
||||
fit.shipName, fit.shipNameShort = shipMap[fit.shipID]
|
||||
except KeyError:
|
||||
pass
|
||||
return fits
|
||||
|
||||
Reference in New Issue
Block a user