791 Commits
Author SHA1 Message Date
Alex Williams 550ac23b9e Adding merc coin collection via statistics journal event 2026-09-16 23:13:00 +01:00
David Sangrey b64e32564f [Nit] Update Set call to Set Comprehension 2026-08-15 15:06:03 -04:00
David Sangrey 0f3bd73161 [#2601] Enforce Schema Validation of Unique Modules 2026-08-15 13:05:37 -04:00
David Sangrey f6eeecf08b [#2601] DeDuplicate statusFlags PowerPlay Entry 2026-08-15 13:01:51 -04:00
David Sangrey 549482e752 Continued Refactor 2026-06-10 20:13:28 -04:00
David Sangrey 089c17a2f5 Additional Refactors, match case adds 2026-06-08 20:27:26 -04:00
David Sangrey 17ad4ff61a First Pass - Refactor Older Functions 2026-06-08 18:32:46 -04:00
David Sangrey decd9e3c6a Remove oldstyle union typings 2026-06-06 15:53:48 -04:00
David Sangrey 6007a2451a Deprecate obsolete timeout_session
No Longer Required for Project, will remove to clean up space.
2026-05-31 16:38:47 -04:00
David Sangrey 10dbee2bb8 Silence Flake8 2026-05-30 12:24:11 -04:00
David Sangrey 1425432abd [#2615] Prevent Linux NONE Toml Config Crash 2026-05-28 21:37:05 -04:00
David Sangrey 1167030b07 Merge branch 'develop' of https://github.com/EDCD/EDMarketConnector into develop 2026-05-28 21:25:07 -04:00
David Sangrey 29339c09b3 [#2642] Update Inara Link 2026-05-28 21:24:44 -04:00
David Sangrey 3da7a2a9fa Merge pull request #2643 from Brighter-Applications/cmdr-coriolis
Adding to the coriolis 'core' plugin, the ability to add an API key f…
2026-05-28 21:18:46 -04:00
Michael K Williams e9d288daca Add CAPI sync hook for Coriolis CMDR ship detection
Add cmdr_data() hook and _build_loadout_from_capi() to the coriolis
plugin. This sends the current ship loadout to the Coriolis CMDR API
whenever EDMC fetches fresh data from Frontier's CAPI (on docking and
manual sync button press).

This is the primary mechanism for detecting ship changes after a
ShipyardSwap, because the Loadout journal event may not be forwarded
to plugins by EDMC after a catch-up replay.

Also:
- Remove unused json import
- Extract _handle_ship_event and _handle_module_event helpers to
  reduce journal_entry complexity below flake8 threshold (C901)
- Add datetime import for CAPI timestamp generation
2026-04-30 16:24:20 +01:00
Alex Williams c25283eff9 Adding to the coriolis 'core' plugin, the ability to add an API key for cmdr.coriolis.io and when added, the ability to send material, ship and module data to cmdr.coriolis.io with the users consent. 2026-04-11 13:56:24 +01:00
David Sangrey 0f8b338ad3 Update edastro_core.py 2026-03-08 01:07:21 -05:00
rinkulu 9a5b82005a [#2619] Fix EDAstro plugin sending data regardless of the user setting 2026-02-22 12:39:48 +03:00
David Sangrey 99709c0146 [#2444] Invert Link Opener Priority 2026-01-07 21:52:14 -05:00
David Sangrey dc90353d2f Deprecate text.gzip
This didn't really have any impact given that we can always compress EDDN data.
2026-01-04 23:19:14 -05:00
David Sangrey 5ea845c3ac Update for New Enum 2026-01-04 20:05:34 -05:00
David Sangrey beb68efae8 [2568] Fix Ships JSON Typo 2025-12-25 01:36:24 -05:00
Inutt 523f890e7b Fix if->elif left over from reverts 2025-12-05 00:25:44 +00:00
Inutt 140f0fbc41 Revert "[#2532] Ignore Loadout If Embarked"
This reverts commit b85705c13a.
2025-12-05 00:23:15 +00:00
Inutt 26e3407f53 Revert "Add Multicrew Check Too"
This reverts commit a8e34f2a3b.
2025-12-05 00:20:14 +00:00
David Sangrey 2041b3d3d3 [Minor] Update Type Hints and Alias Usages 2025-12-01 22:04:28 -05:00
Inutt 9fd04e5c02 Add localisation of stations names
This currently only affects system colonisation ships, which have '$EXT_PANEL_ColonisationShip;' in their StationName
entries in the journal. Other strings may need to be added in future.

Fixes #2404
diff --git a/L10n/en.template b/L10n/en.template
index faac3259..f670e39c 100644
--- a/L10n/en.template
+++ b/L10n/en.template
@@ -839,3 +839,9 @@

 /* edastro_core.py: Settings>EDAstro - Label on checkbox for 'send data'; */
 "Send data to EDAstro" = "Send data to EDAstro";
+
+/* common_coreutils.py: Colonisation ship name, with title; In files: common_coreutils.py:81:81 */
+"System Colonisation Ship {NAME}" = "System Colonisation Ship {NAME}";
+
+/* common_coreutils.py: Unidentified colonisation ship; In files: common_coreutils.py:84:84 */
+"System Colonisation Ship" = "System Colonisation Ship";
diff --git a/plugins/common_coreutils.py b/plugins/common_coreutils.py
index 6b90d4dc..a488de46 100644
--- a/plugins/common_coreutils.py
+++ b/plugins/common_coreutils.py
@@ -29,6 +29,7 @@ import gzip
 import io
 import json
 import os
+import re
 import myNotebook as nb  # noqa: N813
 from EDMCLogging import get_main_logger
 from companion import CAPIData
@@ -47,6 +48,49 @@ SEPY = 10  # seperator line spacing
 STATION_UNDOCKED = '×'  # "Station" name to display when not docked = U+00D7

+# Known colonisation ship names match one of the following:
+#   "$EXT_PANEL_ColonisationShip;"
+#   "$EXT_PANEL_ColonisationShip; <ship name>" with "<ship name>" being eg; "Okawara Horizons"
+#   "$EXT_PANEL_ColonisationShip:#index=<number>;"
+#   "$EXT_PANEL_ColonisationShip:#index=<number>; <ship name>"
+_RE_COLONISATION_SHIP = re.compile(r'\$EXT_PANEL_ColonisationShip(?::#index=(\d+))?;(?: (.+))?')
+
+
+def localised_name(value: str | None) -> str | None:
+    """
+    Handle localisation of strings in places like station names.
+
+    This is currently an issue for system colonisation ships that have a station name along the
+    lines of "$EXT_PANEL_ColonisationShip; Okawara Horizons" when written to the journal, but would
+    be better displayed as "System Colonisation Ship Okawara Horizona" (or other appropriately
+    localised equivalent).
+
+    If no (known) localisable strings are present, the input will be returned unmodified.
+
+    :param value: The non-localised string.
+    :return: The localised string, or None if the input was None.
+    """
+    if value is None:
+        return None
+
+    colonisation_ship_match = _RE_COLONISATION_SHIP.match(value)
+    if colonisation_ship_match:
+        ship_index = colonisation_ship_match.group(1)
+        ship_name = colonisation_ship_match.group(2)
+        # Use the ship's index as its name if no name was provided.
+        ship_id = ship_name or ship_index
+
+        if ship_id:
+            # LANG: Colonisation ship name, with title
+            value = tr.tl("System Colonisation Ship {NAME}").format(NAME=ship_id)
+
+        else:
+            # LANG: Unidentified colonisation ship
+            value = tr.tl("System Colonisation Ship")
+
+    return value
+
+
 def plugin_start3(plugin_dir: str) -> str:
     """
     Start the plugin.
@@ -121,7 +165,7 @@ def station_link_common(data: CAPIData, this):
     :param this: The module global from the calling module.
     """
     if data['commander']['docked'] or this.on_foot and this.station_name:
-        this.station_link['text'] = this.station_name
+        this.station_link['text'] = localised_name(this.station_name)
     elif data['lastStarport']['name'] and data['lastStarport']['name'] != "":
         this.station_link['text'] = STATION_UNDOCKED
     else:
@@ -163,12 +207,14 @@ def station_name_setter_common(this):
     :param this: The module global from the calling module.
     """
     to_set: str = cast(str, this.station_name)
+
     if not to_set:
         if this.system_population is not None and this.system_population > 0:
             to_set = STATION_UNDOCKED
         else:
             to_set = ''

+    to_set = str(localised_name(to_set))
     this.station_link['text'] = to_set

diff --git a/plugins/edsm.py b/plugins/edsm.py
index e1e6b168..902e248b 100644
--- a/plugins/edsm.py
+++ b/plugins/edsm.py
@@ -43,7 +43,7 @@ from ttkHyperlinkLabel import HyperlinkLabel
 from l10n import translations as tr
 from plugins.common_coreutils import (api_keys_label_common, PADX, PADY, BUTTONX, SEPY, BOXY, STATION_UNDOCKED,
                                       show_pwd_var_common, station_link_common, this_format_common,
-                                      cmdr_data_initial_common)
+                                      cmdr_data_initial_common, localised_name)

 # TODO:
@@ -543,7 +543,7 @@ entry: {entry!r}'''
                 to_set = ''

         if this.station_link:
-            this.station_link['text'] = to_set
+            this.station_link['text'] = localised_name(to_set)
             this.station_link['url'] = station_url(str(this.system_name), str(this.station_name))
             this.station_link.update_idletasks()
2025-11-29 01:25:19 +00:00
David Sangrey a8e34f2a3b Add Multicrew Check Too 2025-11-20 18:00:06 -05:00
David Sangrey b85705c13a [#2532] Ignore Loadout If Embarked 2025-11-20 17:53:57 -05:00
David Sangrey 71e803f8b5 [Minor] Don't Continually Enable EDAstro 2025-11-13 22:31:02 -05:00
David Sangrey 5405664d52 [Minor] Don't Continually Enable EDAstro 2025-11-13 22:26:00 -05:00
David Sangrey a6bafe58b7 Remove Deprecated Functions 2025-11-13 21:45:06 -05:00
David Sangrey 03cbe85535 [2116] A Few More Hand-Overs 2025-11-11 23:17:02 -05:00
David Sangrey c3f9247cd1 [#2116] Hand more things to TTK 2025-11-11 20:24:58 -05:00
David Sangrey 497528c32a Merge pull request #2522 from HullSeals/enhancement/2430/edastro_core
Add EDAstro Plugin
2025-11-11 19:10:29 -05:00
David Sangrey f9ccba3aa1 [2430] Add ScanOrganic 2025-11-11 19:07:28 -05:00
David Sangrey de72947098 Merge pull request #2501 from klightspeed/fix-eddn-parent
[Bugfix] Fix EDDN queue not processing at startup
2025-11-09 19:09:17 -05:00
David Sangrey 715553207f [#2430] First-Pass EDAstro Core Plugin 2025-11-09 18:00:50 -05:00
David Sangrey 6d474abd01 Update Dep Warnings using Python 3.13 Syntax 2025-11-09 13:40:04 -05:00
Ben Peddell 13487ff763 [Bugfix] Fix EDDN queue not processing at startup
Workaround the `.after()` queue being cleared (or invalidated) when the
widget that call was made through is destroyed after that call is made,
which in this case resulted in the EDDN queue not being processed until
some other action re-triggered processing of the EDDN queue.
2025-10-04 21:58:21 +10:00
David Sangrey d6fb5d7477 [#2375] Improve Legacy Queue Detection 2025-05-19 22:00:17 -04:00
David Sangrey 73e134e39d [#2415] Fix Inara Linking 2025-05-03 19:39:28 -04:00
David Sangrey e31de6a999 [2406] Update BooleanVar when on CMDLINE 2025-04-14 21:33:17 -04:00
David Sangrey f0d20f6534 [Minor] Remove Dupe Undock 2025-04-13 13:51:25 -04:00
David Sangrey 26f06b7bf0 [#2406] Consolidate Modules 2025-04-13 13:42:06 -04:00
David Sangrey 749ae939b5 [Minor] Flake8 Linter Run 2025-03-31 20:31:23 -04:00
David Muckle 2b4c8280c3 Update powerplay tracking to account for new journal events 2025-03-24 20:08:50 -04:00
David Muckle 9ff3327ff7 Add code to track PP2.0 rank, merits, etc 2025-02-20 19:17:50 -05:00
David Sangrey 6bc29f07d6 Merge pull request #2276 from HansAcker/eddn-nowip
pass Horizons/Odyssey flags in NavRoute
2024-08-26 18:26:58 -04:00
David Sangrey 6a3691d755 [2278] Fix Incomplete OrderedDict 2024-07-29 18:58:30 -04:00