Force EFT export to English variant

This commit is contained in:
blitzmann
2020-06-28 17:41:28 -04:00
parent 77d233ca1c
commit 3db9c637e0

View File

@@ -64,7 +64,7 @@ def exportEft(fit, options, callback):
# sub-sections, which are separated by 1 blank line
sections = []
header = '[{}, {}]'.format(fit.ship.item.name, fit.name)
header = '[{}, {}]'.format(fit.ship.item.typeName, fit.name)
# Section 1: modules, rigs, subsystems, services
modsBySlotType = {}
@@ -81,9 +81,9 @@ def exportEft(fit, options, callback):
if module.item:
# if module was mutated, use base item name for export
if module.isMutated:
modName = module.baseItem.name
modName = module.baseItem.typeName
else:
modName = module.item.name
modName = module.item.typeName
if module.isMutated and options[PortEftOptions.MUTATIONS]:
mutants[mutantReference] = module
mutationSuffix = ' [{}]'.format(mutantReference)
@@ -93,7 +93,7 @@ def exportEft(fit, options, callback):
modOfflineSuffix = ' {}'.format(OFFLINE_SUFFIX) if module.state == FittingModuleState.OFFLINE else ''
if module.charge and options[PortEftOptions.LOADED_CHARGES]:
rackLines.append('{}, {}{}{}'.format(
modName, module.charge.name, modOfflineSuffix, mutationSuffix))
modName, module.charge.typeName, modOfflineSuffix, mutationSuffix))
else:
rackLines.append('{}{}{}'.format(modName, modOfflineSuffix, mutationSuffix))
else:
@@ -153,36 +153,36 @@ def exportEft(fit, options, callback):
def exportDrones(drones):
droneLines = []
for drone in sorted(drones, key=lambda d: d.item.name):
droneLines.append('{} x{}'.format(drone.item.name, drone.amount))
for drone in sorted(drones, key=lambda d: d.item.typeName):
droneLines.append('{} x{}'.format(drone.item.typeName, drone.amount))
return '\n'.join(droneLines)
def exportFighters(fighters):
fighterLines = []
for fighter in sorted(fighters, key=lambda f: f.item.name):
fighterLines.append('{} x{}'.format(fighter.item.name, fighter.amount))
for fighter in sorted(fighters, key=lambda f: f.item.typeName):
fighterLines.append('{} x{}'.format(fighter.item.typeName, fighter.amount))
return '\n'.join(fighterLines)
def exportImplants(implants):
implantLines = []
for implant in sorted(implants, key=lambda i: i.slot or 0):
implantLines.append(implant.item.name)
implantLines.append(implant.item.typeName)
return '\n'.join(implantLines)
def exportBoosters(boosters):
boosterLines = []
for booster in sorted(boosters, key=lambda b: b.slot or 0):
boosterLines.append(booster.item.name)
boosterLines.append(booster.item.typeName)
return '\n'.join(boosterLines)
def exportCargo(cargos):
cargoLines = []
for cargo in sorted(cargos, key=lambda c: (c.item.group.category.name, c.item.group.name, c.item.name)):
cargoLines.append('{} x{}'.format(cargo.item.name, cargo.amount))
for cargo in sorted(cargos, key=lambda c: (c.item.group.category.name, c.item.group.name, c.item.typeName)):
cargoLines.append('{} x{}'.format(cargo.item.typeName, cargo.amount))
return '\n'.join(cargoLines)