mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-14 00:07:14 +03:00
Track system population in monitor, and use in eddb
EDDB station link now triggers off this.system_population, which is received via monitor passing 'Population' through in Startup, Location, FSDJump and CarrierJump events. One fewer use cases for systems.p (populated status in this case).
This commit is contained in:
parent
ad81339495
commit
0541e404ec
@ -223,6 +223,7 @@ class EDLogs(FileSystemEventHandler):
|
||||
('StarSystem', self.system),
|
||||
('StarPos', self.coordinates),
|
||||
('SystemAddress', self.systemaddress),
|
||||
('Population', self.systempopulation),
|
||||
])
|
||||
if self.planet:
|
||||
entry['Body'] = self.planet
|
||||
@ -446,6 +447,10 @@ class EDLogs(FileSystemEventHandler):
|
||||
elif self.system != entry['StarSystem']:
|
||||
self.coordinates = None # Docked event doesn't include coordinates
|
||||
self.systemaddress = entry.get('SystemAddress')
|
||||
|
||||
if entry['event'] in ['Location', 'FSDJump', 'CarrierJump']:
|
||||
self.systempopulation = entry.get('Population')
|
||||
|
||||
(self.system, self.station) = (entry['StarSystem'] == 'ProvingGround' and 'CQC' or entry['StarSystem'],
|
||||
entry.get('StationName')) # May be None
|
||||
self.station_marketid = entry.get('MarketID') # May be None
|
||||
|
@ -59,6 +59,7 @@ def plugin_start3(plugin_dir):
|
||||
|
||||
def plugin_app(parent):
|
||||
this.system_link = parent.children['system'] # system label in main window
|
||||
this.system_population = None
|
||||
this.station_marketid = None # Frontier MarketID
|
||||
this.station_link = parent.children['station'] # station label in main window
|
||||
this.station_link.configure(popup_copy = lambda x: x != STATION_UNDOCKED)
|
||||
@ -73,11 +74,15 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
|
||||
this.system_link['url'] = system_url(system) # Override standard URL function
|
||||
|
||||
if config.get('station_provider') == 'eddb':
|
||||
if entry['event'] in ['StartUp', 'Location', 'FSDJump', 'CarrierJump']:
|
||||
this.system_population = entry.get('Population')
|
||||
|
||||
if entry['event'] in ['StartUp', 'Location', 'Docked', 'CarrierJump']:
|
||||
this.station_marketid = entry.get('MarketID')
|
||||
elif entry['event'] in ['Undocked']:
|
||||
this.station_marketid = None
|
||||
this.station_link['text'] = station or (system_populated(system) and STATION_UNDOCKED or '')
|
||||
|
||||
this.station_link['text'] = station or (this.system_population and this.system_population > 0 and STATION_UNDOCKED or '')
|
||||
this.station_link.update_idletasks()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user