From eeed2cf7af6e4c9950b7f14b5003de4c51aa1df4 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Tue, 18 May 2021 17:02:45 +0100 Subject: [PATCH] Initial attempt at `SuitLoadout` event support Need to see examples to be sure. --- monitor.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/monitor.py b/monitor.py index 47b82082..82cfab7a 100644 --- a/monitor.py +++ b/monitor.py @@ -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)