From fd0ce6334115e1ccc24773391fd808c0c9cba41d Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 10 Mar 2021 12:07:39 +0000 Subject: [PATCH] Add basic support for ModuleInfo event. This still needs documentation adding in PLUGINS.md, which is easiest done after #897 is merged and re-based upon. --- monitor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/monitor.py b/monitor.py index c6982103..11afd2f9 100644 --- a/monitor.py +++ b/monitor.py @@ -680,6 +680,11 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below else: self.state['NavRoute'] = entry + elif event_type == 'ModuleInfo': + with open(join(self.currentdir, 'ModulesInfo.json'), 'rb') as mf: # type: ignore + entry = json.load(mf) + self.state['ModuleInfo'] = entry + elif event_type in ('CollectCargo', 'MarketBuy', 'BuyDrones', 'MiningRefined'): commodity = self.canonicalise(entry['Type']) self.state['Cargo'][commodity] += entry.get('Count', 1)