mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-16 07:12:17 +03:00
Suits: If user switches to an unknown loadout, say so
This commit is contained in:
parent
c28dd8c55d
commit
bb90d0fb59
@ -607,11 +607,13 @@ class AppWindow(object):
|
|||||||
def update_suit_text(self) -> None:
|
def update_suit_text(self) -> None:
|
||||||
"""Update the suit text for current type and loadout."""
|
"""Update the suit text for current type and loadout."""
|
||||||
if (suit := monitor.state.get('SuitCurrent')) is None:
|
if (suit := monitor.state.get('SuitCurrent')) is None:
|
||||||
|
self.suit['text'] = f'<{_("Unknown")}>'
|
||||||
return
|
return
|
||||||
|
|
||||||
suitname = suit['locName']
|
suitname = suit['locName']
|
||||||
|
|
||||||
if (suitloadout := monitor.state.get('SuitLoadoutCurrent')) is None:
|
if (suitloadout := monitor.state.get('SuitLoadoutCurrent')) is None:
|
||||||
|
self.suit['text'] = ''
|
||||||
return
|
return
|
||||||
|
|
||||||
loadout_name = suitloadout['name']
|
loadout_name = suitloadout['name']
|
||||||
|
@ -839,6 +839,8 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
logger.exception(f"Getting suit loadout after switch, bad slot: {new_slot} ({loadoutid})")
|
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 ?
|
# 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:
|
else:
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user