1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 17:42:20 +03:00

Initial attempt at SuitLoadout event support

Need to see examples to be sure.
This commit is contained in:
Athanasius 2021-05-18 17:02:45 +01:00
parent a50ed31450
commit eeed2cf7af

View File

@ -1043,6 +1043,22 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
# also there's one additional journal event that was missed out from
# this version of the docs: "SuitLoadout": # when starting on foot, or
# when disembarking from a ship, with the same info as found in "CreateSuitLoadout"
elif event_type == 'SuitLoadout':
new_loadout = {
'loadoutSlotId': self.suit_loadout_id_from_loadoutid(entry['LoadoutID']),
'suit': {
'name': entry['SuitName'],
'locName': entry.get('SuitName_Localised', entry['SuitName']),
'suitId': entry['SuitID'],
},
'name': entry['LoadoutName'],
'slots': self.suit_loadout_slots_array_to_dict(entry['Modules']),
}
self.state['SuitLoadouts'][new_loadout['loadoutSlotId']] = new_loadout
self.state['SuitLoadoutCurrent'] = new_loadout
# TODO: Well we know about the **SUIT**, as opposed to the Loadout ?
# self.state['SuitCurrent'] = self.state['Suits'][f'{new_suitid}']
elif event_type == 'SwitchSuitLoadout':
loadoutid = entry['LoadoutID']
new_slot = self.suit_loadout_id_from_loadoutid(loadoutid)