1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 16:27:13 +03:00

Use both Ship and GameMode fields of LoadGame event to detect CQC

And freeze update button when in CQC
This commit is contained in:
norohind 2021-08-09 15:59:30 +03:00
parent 27fe43bf8c
commit 291fbf2908
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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: