mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-04 19:40:02 +03:00
Add code to track PP2.0 rank, merits, etc
This commit is contained in:
parent
310cf9f875
commit
9ff3327ff7
14
monitor.py
14
monitor.py
@ -179,6 +179,13 @@ class EDLogs(FileSystemEventHandler):
|
||||
'StationName': None,
|
||||
|
||||
'NavRoute': None,
|
||||
'Powerplay': {
|
||||
'Power': None,
|
||||
'Rank': None,
|
||||
'Merits': None,
|
||||
'Votes': None,
|
||||
'TimePledged': None,
|
||||
},
|
||||
}
|
||||
|
||||
def start(self, root: 'tkinter.Tk') -> bool: # noqa: CCR001
|
||||
@ -1839,6 +1846,13 @@ class EDLogs(FileSystemEventHandler):
|
||||
# There should be a `Backpack` event as you 'come to' in the
|
||||
# new location, so no need to zero out BackPack here.
|
||||
|
||||
elif event_type == 'powerplay':
|
||||
self.state['Powerplay']['Power'] = entry.get('Power', '')
|
||||
self.state['Powerplay']['Rank'] = entry.get('Rank', 0)
|
||||
self.state['Powerplay']['Merits'] = entry.get('Merits', 0)
|
||||
self.state['Powerplay']['Votes'] = entry.get('Votes', 0)
|
||||
self.state['Powerplay']['TimePledged'] = entry.get('TimePledged', 0)
|
||||
|
||||
return entry
|
||||
|
||||
except Exception as ex:
|
||||
|
@ -548,6 +548,10 @@ def journal_entry( # noqa: C901, CCR001
|
||||
power_defect_data = {'powerName': entry["ToPower"], 'rankValue': 1}
|
||||
new_add_event('setCommanderRankPower', entry['timestamp'], power_defect_data)
|
||||
|
||||
elif event_name == 'Powerplay':
|
||||
power_data = {'powerName': entry["Power"], 'rankValue': entry["Rank"], 'meritsValue': entry["Merits"]}
|
||||
new_add_event('setCommanderRankPower', entry['timestamp'], power_data)
|
||||
|
||||
# Ship change
|
||||
if event_name == 'Loadout' and this.shipswap:
|
||||
this.loadout = make_loadout(state)
|
||||
|
Loading…
x
Reference in New Issue
Block a user