mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-03 09:01:13 +03:00
Merge pull request #2212 from HullSeals/enhancement/1654/add-shiprange-and-cargocapacity
[1654] Add Ship Jump Range and Cargo Capacity to Inara
This commit is contained in:
commit
3e0d6e5b65
@ -550,23 +550,6 @@ def journal_entry( # noqa: C901, CCR001
|
|||||||
|
|
||||||
# Ship change
|
# Ship change
|
||||||
if event_name == 'Loadout' and this.shipswap:
|
if event_name == 'Loadout' and this.shipswap:
|
||||||
cur_ship = {
|
|
||||||
'shipType': state['ShipType'],
|
|
||||||
'shipGameID': state['ShipID'],
|
|
||||||
'shipName': state['ShipName'], # Can be None
|
|
||||||
'shipIdent': state['ShipIdent'], # Can be None
|
|
||||||
'isCurrentShip': True,
|
|
||||||
}
|
|
||||||
|
|
||||||
if state['HullValue']:
|
|
||||||
cur_ship['shipHullValue'] = state['HullValue']
|
|
||||||
|
|
||||||
if state['ModulesValue']:
|
|
||||||
cur_ship['shipModulesValue'] = state['ModulesValue']
|
|
||||||
|
|
||||||
cur_ship['shipRebuyCost'] = state['Rebuy']
|
|
||||||
new_add_event('setCommanderShip', entry['timestamp'], cur_ship)
|
|
||||||
|
|
||||||
this.loadout = make_loadout(state)
|
this.loadout = make_loadout(state)
|
||||||
new_add_event('setCommanderShipLoadout', entry['timestamp'], this.loadout)
|
new_add_event('setCommanderShipLoadout', entry['timestamp'], this.loadout)
|
||||||
this.shipswap = False
|
this.shipswap = False
|
||||||
@ -854,7 +837,7 @@ def journal_entry( # noqa: C901, CCR001
|
|||||||
for ship in this.fleet:
|
for ship in this.fleet:
|
||||||
new_add_event('setCommanderShip', entry['timestamp'], ship)
|
new_add_event('setCommanderShip', entry['timestamp'], ship)
|
||||||
# Loadout
|
# Loadout
|
||||||
if event_name == 'Loadout' and not this.newsession:
|
if event_name == 'Loadout':
|
||||||
loadout = make_loadout(state)
|
loadout = make_loadout(state)
|
||||||
if this.loadout != loadout:
|
if this.loadout != loadout:
|
||||||
this.loadout = loadout
|
this.loadout = loadout
|
||||||
@ -868,6 +851,26 @@ def journal_entry( # noqa: C901, CCR001
|
|||||||
|
|
||||||
new_add_event('setCommanderShipLoadout', entry['timestamp'], this.loadout)
|
new_add_event('setCommanderShipLoadout', entry['timestamp'], this.loadout)
|
||||||
|
|
||||||
|
cur_ship = {
|
||||||
|
'shipType': state['ShipType'],
|
||||||
|
'shipGameID': state['ShipID'],
|
||||||
|
'shipName': state['ShipName'], # Can be None
|
||||||
|
'shipIdent': state['ShipIdent'], # Can be None
|
||||||
|
'isCurrentShip': True,
|
||||||
|
'shipMaxJumpRange': entry['MaxJumpRange'],
|
||||||
|
'shipCargoCapacity': entry['CargoCapacity']
|
||||||
|
}
|
||||||
|
if state['HullValue']:
|
||||||
|
cur_ship['shipHullValue'] = state['HullValue']
|
||||||
|
|
||||||
|
if state['ModulesValue']:
|
||||||
|
cur_ship['shipModulesValue'] = state['ModulesValue']
|
||||||
|
|
||||||
|
if state['Rebuy']:
|
||||||
|
cur_ship['shipRebuyCost'] = state['Rebuy']
|
||||||
|
|
||||||
|
new_add_event('setCommanderShip', entry['timestamp'], cur_ship)
|
||||||
|
|
||||||
# Stored modules
|
# Stored modules
|
||||||
if event_name == 'StoredModules':
|
if event_name == 'StoredModules':
|
||||||
items = {mod['StorageSlot']: mod for mod in entry['Items']} # Impose an order
|
items = {mod['StorageSlot']: mod for mod in entry['Items']} # Impose an order
|
||||||
|
Loading…
x
Reference in New Issue
Block a user