mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-11-28 03:32:23 +03:00
Remove the last of the {stations,systems}.p code from EDDB plugin
There is one tiny regression for a very, very corner case. In 3.46 if you use EDDB as the 'Station' provider and: 1. Dock at Station A, in System X 2. Jump out to System Y, which is also populated 3. Exit out of the game 4. (Re-)Start EDMC 5. Hit 'Update' to manually trigger CAPI data retrieval you will see a "×" character as the Station Name, and can click on it to take you to the EDDB *System* page. It is only there because of EDMC using systems.p to check if System Y is populated. With this version in that circumstance there's no way to know that System Y is populated, so the code assumes not and doesn't show the "×", and thus there's nothing to click to go to the EDDB *System* page for System Y. But so long as the user is actually running the game and EDMC together then populated status is detected from Journal events and the "×" will be there whenever you're undocked but in a populated system. Caveat: We know Frontier have allowed some systems that are technically populated, but show a Population of zero. This code assumes that means they're *not* populated.
This commit is contained in:
1 parent
0541e404ec
commit
f6b3109a09
1 file changed
+1
-14
+1
-14
@@ -41,19 +41,6 @@ def station_url(system_name, station_name):
|
||||
return system_url(system_name)
|
||||
|
||||
|
||||
# system_name -> system_id or 0
|
||||
def system_id(system_name):
|
||||
return this.system_ids.get(system_name, [0, False])[0]
|
||||
|
||||
# system_name -> is_populated
|
||||
def system_populated(system_name):
|
||||
return this.system_ids.get(system_name, [0, False])[1]
|
||||
|
||||
# (system_name, station_name) -> station_id or 0
|
||||
def station_id(system_name, station_name):
|
||||
return this.station_ids.get((system_id(system_name), station_name), 0)
|
||||
|
||||
|
||||
def plugin_start3(plugin_dir):
|
||||
return 'eddb'
|
||||
|
||||
@@ -92,5 +79,5 @@ def cmdr_data(data, is_beta):
|
||||
|
||||
if config.get('station_provider') == 'eddb':
|
||||
this.station_marketid = data['commander']['docked'] and data['lastStarport']['id']
|
||||
this.station_link['text'] = data['commander']['docked'] and data['lastStarport']['name'] or (system_populated(data['lastSystem']['name']) and STATION_UNDOCKED or '')
|
||||
this.station_link['text'] = data['commander']['docked'] and data['lastStarport']['name'] or (data['lastStarport']['name'] and data['lastStarport']['name'] != "" and STATION_UNDOCKED or '')
|
||||
this.station_link.update_idletasks()
|
||||
Reference in new issue
Block a user