1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 15:57:14 +03:00

Add ship name to EDShipyard export

This commit is contained in:
Jonathan Harris 2017-10-31 09:46:50 +00:00
parent d669bc2867
commit 0f147e516e
2 changed files with 4 additions and 2 deletions

View File

@ -117,7 +117,8 @@ def export(data, filename=None):
if __debug__: raise
# Construct description
string = '[%s]\n' % ship_map.get(data['ship']['name'].lower(), data['ship']['name'])
ship = ship_map.get(data['ship']['name'].lower(), data['ship']['name'])
string = '[%s]\n' % (data['ship'].get('shipName') and ', '.join([ship, data['ship']['shipName']]) or ship)
for slot in ['H', 'L', 'M', 'S', 'U', None, 'BH', 'RB', 'TM', 'FH', 'EC', 'PC', 'SS', 'FS', None, 'MC', None, '9', '8', '7', '6', '5', '4', '3', '2', '1']:
if not slot:
string += '\n'
@ -132,7 +133,7 @@ def export(data, filename=None):
try:
# https://github.com/cmmcleod/coriolis/blob/master/app/js/shipyard/module-shipyard.js#L184
mass += ships[companion.ship_map[data['ship']['name'].lower()]]['hullMass']
string += 'Mass : %.1f T empty\n %.1f T full\n' % (mass, mass + fuel + cargo)
string += 'Mass : %.2f T empty\n %.2f T full\n' % (mass, mass + fuel + cargo)
multiplier = pow(min(fuel, fsd['maxfuel']) / fsd['fuelmul'], 1.0 / fsd['fuelpower']) * fsd['optmass']
string += 'Range : %.2f LY unladen\n %.2f LY laden\n' % (
multiplier / (mass + fuel),

View File

@ -49,6 +49,7 @@ weapon_map = {
missiletype_map = {
'advancedtorppylon' : 'Seeker',
'atdumbfiremissile' : 'Dumbfire',
'basicmissilerack' : 'Seeker',
'drunkmissilerack' : 'Swarm',
'dumbfiremissilerack' : 'Dumbfire',