From 291fbf2908e0f7419769a7727ee0a79cf58a9342 Mon Sep 17 00:00:00 2001 From: norohind <60548839+norohind@users.noreply.github.com> Date: Mon, 9 Aug 2021 15:59:30 +0300 Subject: [PATCH] Use both Ship and GameMode fields of LoadGame event to detect CQC And freeze update button when in CQC --- EDMarketConnector.py | 2 +- monitor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 9a076a73..49e9fb80 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -1345,7 +1345,7 @@ class AppWindow(object): self.button['text'] = self.theme_button['text'] = _('Update') # LANG: Update button in main window self.button['state'] = self.theme_button['state'] = (monitor.cmdr and monitor.mode and - # and monitor.mode == 'CQC' and + monitor.mode == 'CQC' and not monitor.state['Captain'] and monitor.system and tk.NORMAL or tk.DISABLED) diff --git a/monitor.py b/monitor.py index 98d152b5..4c94cecf 100644 --- a/monitor.py +++ b/monitor.py @@ -530,7 +530,7 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below # Odyssey: bool self.cmdr = entry['Commander'] # 'Open', 'Solo', 'Group', or None for CQC (and Training - but no LoadGame event) - if not entry.get('Ship'): # TODO: Test with loading to CQC right from main game + if not entry.get('Ship') and not entry.get('GameMode'): logger.debug(f'loadgame to cqc: {entry}') self.mode = 'CQC' else: