1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-15 00:30:33 +03:00

config/EDDN: Rename OUT_SYS_EDDN to OUT_EDDN_SEND_NON_STATION

* This was perhaps originally meant for what the UI option says, i.e. "send
  system and scan data", but is actually being used for anything that is
  **NOT** 'station data' (even though *that* option has 'MKT' it includes
  outfitting and shipyard as well).

  So, just name this more sanely such that code using it is more obvious as
  to the actual intent.
This commit is contained in:
Athanasius 2022-10-05 15:26:43 +01:00 committed by Athanasius
parent 3a57b53bbd
commit 9f02f18408
No known key found for this signature in database
GPG Key ID: 772697E181BB2767
3 changed files with 7 additions and 7 deletions

View File

@ -175,7 +175,7 @@ class AbstractConfig(abc.ABC):
# OUT_SYS_EDSM = 256 # Now a plugin # OUT_SYS_EDSM = 256 # Now a plugin
# OUT_SYS_AUTO = 512 # Now always automatic # OUT_SYS_AUTO = 512 # Now always automatic
OUT_MKT_MANUAL = 1024 OUT_MKT_MANUAL = 1024
OUT_SYS_EDDN = 2048 OUT_EDDN_SEND_NON_STATION = 2048
OUT_EDDN_DO_NOT_DELAY = 4096 OUT_EDDN_DO_NOT_DELAY = 4096
app_dir_path: pathlib.Path app_dir_path: pathlib.Path

View File

@ -1824,7 +1824,7 @@ def plugin_prefs(parent, cmdr: str, is_beta: bool) -> Frame:
BUTTONX = 12 # noqa: N806 # indent Checkbuttons and Radiobuttons BUTTONX = 12 # noqa: N806 # indent Checkbuttons and Radiobuttons
if prefsVersion.shouldSetDefaults('0.0.0.0', not bool(config.get_int('output'))): if prefsVersion.shouldSetDefaults('0.0.0.0', not bool(config.get_int('output'))):
output: int = (config.OUT_MKT_EDDN | config.OUT_SYS_EDDN) # default settings output: int = (config.OUT_MKT_EDDN | config.OUT_EDDN_SEND_NON_STATION) # default settings
else: else:
output = config.get_int('output') output = config.get_int('output')
@ -1849,7 +1849,7 @@ def plugin_prefs(parent, cmdr: str, is_beta: bool) -> Frame:
) # Output setting ) # Output setting
this.eddn_station_button.grid(padx=BUTTONX, pady=(5, 0), sticky=tk.W) this.eddn_station_button.grid(padx=BUTTONX, pady=(5, 0), sticky=tk.W)
this.eddn_system = tk.IntVar(value=(output & config.OUT_SYS_EDDN) and 1) this.eddn_system = tk.IntVar(value=(output & config.OUT_EDDN_SEND_NON_STATION) and 1)
# Output setting new in E:D 2.2 # Output setting new in E:D 2.2
this.eddn_system_button = nb.Checkbutton( this.eddn_system_button = nb.Checkbutton(
eddnframe, eddnframe,
@ -1896,7 +1896,7 @@ def prefs_changed(cmdr: str, is_beta: bool) -> None:
(config.get_int('output') (config.get_int('output')
& (config.OUT_MKT_TD | config.OUT_MKT_CSV | config.OUT_SHIP | config.OUT_MKT_MANUAL)) + & (config.OUT_MKT_TD | config.OUT_MKT_CSV | config.OUT_SHIP | config.OUT_MKT_MANUAL)) +
(this.eddn_station.get() and config.OUT_MKT_EDDN) + (this.eddn_station.get() and config.OUT_MKT_EDDN) +
(this.eddn_system.get() and config.OUT_SYS_EDDN) + (this.eddn_system.get() and config.OUT_EDDN_SEND_NON_STATION) +
(this.eddn_delay.get() and config.OUT_EDDN_DO_NOT_DELAY) (this.eddn_delay.get() and config.OUT_EDDN_DO_NOT_DELAY)
) )
@ -2066,7 +2066,7 @@ def journal_entry( # noqa: C901, CCR001
this.status_body_name = None this.status_body_name = None
# Events with their own EDDN schema # Events with their own EDDN schema
if config.get_int('output') & config.OUT_SYS_EDDN and not state['Captain']: if config.get_int('output') & config.OUT_EDDN_SEND_NON_STATION and not state['Captain']:
if event_name == 'fssdiscoveryscan': if event_name == 'fssdiscoveryscan':
return this.eddn.export_journal_fssdiscoveryscan(cmdr, system, state['StarPos'], is_beta, entry) return this.eddn.export_journal_fssdiscoveryscan(cmdr, system, state['StarPos'], is_beta, entry)
@ -2123,7 +2123,7 @@ def journal_entry( # noqa: C901, CCR001
) )
# Send journal schema events to EDDN, but not when on a crew # Send journal schema events to EDDN, but not when on a crew
if (config.get_int('output') & config.OUT_SYS_EDDN and not state['Captain'] and if (config.get_int('output') & config.OUT_EDDN_SEND_NON_STATION and not state['Captain'] and
(event_name in ('location', 'fsdjump', 'docked', 'scan', 'saasignalsfound', 'carrierjump')) and (event_name in ('location', 'fsdjump', 'docked', 'scan', 'saasignalsfound', 'carrierjump')) and
('StarPos' in entry or this.coordinates)): ('StarPos' in entry or this.coordinates)):

View File

@ -1221,7 +1221,7 @@ class PreferencesDialog(tk.Toplevel):
(self.out_csv.get() and config.OUT_MKT_CSV) + (self.out_csv.get() and config.OUT_MKT_CSV) +
(config.OUT_MKT_MANUAL if not self.out_auto.get() else 0) + (config.OUT_MKT_MANUAL if not self.out_auto.get() else 0) +
(self.out_ship.get() and config.OUT_SHIP) + (self.out_ship.get() and config.OUT_SHIP) +
(config.get_int('output') & (config.OUT_MKT_EDDN | config.OUT_SYS_EDDN | config.OUT_EDDN_DO_NOT_DELAY)) (config.get_int('output') & (config.OUT_MKT_EDDN | config.OUT_EDDN_SEND_NON_STATION | config.OUT_EDDN_DO_NOT_DELAY))
) )
config.set( config.set(