From bb90d0fb590a9ca0bc15e9379c2ccb68eabf61cc Mon Sep 17 00:00:00 2001 From: Athanasius Date: Tue, 13 Apr 2021 16:56:48 +0100 Subject: [PATCH] Suits: If user switches to an unknown loadout, say so --- EDMarketConnector.py | 2 ++ monitor.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 6ca1c966..a1b8ab02 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -607,11 +607,13 @@ class AppWindow(object): def update_suit_text(self) -> None: """Update the suit text for current type and loadout.""" if (suit := monitor.state.get('SuitCurrent')) is None: + self.suit['text'] = f'<{_("Unknown")}>' return suitname = suit['locName'] if (suitloadout := monitor.state.get('SuitLoadoutCurrent')) is None: + self.suit['text'] = '' return loadout_name = suitloadout['name'] diff --git a/monitor.py b/monitor.py index cc27865d..52bb22bc 100644 --- a/monitor.py +++ b/monitor.py @@ -839,6 +839,8 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below except KeyError: logger.exception(f"Getting suit loadout after switch, bad slot: {new_slot} ({loadoutid})") # Might mean that a new suit loadout was created and we need a new CAPI fetch ? + self.state['SuitCurrent'] = None + self.state['SuitLoadoutCurrent'] = None else: try: