From f85213b3188269793c3256ffd0f7dcb15ab0eade Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Tue, 25 May 2021 14:52:43 +0100 Subject: [PATCH] Suits: Initial stab at grabbing a usable name out of a $symbol; version --- monitor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/monitor.py b/monitor.py index a0c15881..eca0d5b0 100644 --- a/monitor.py +++ b/monitor.py @@ -1603,6 +1603,13 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below :return: Our sane version of this suit's name. """ # TODO: Localisation ? + # Stage 1: Is it in `$<type>_Class<X>_Name;` form ? + if (m := re.fullmatch(r'^\$([^_]+)_Class([0-9]+)_Name$', name)): + n, c = m.group(1, 2) + name = n + + # Stage 2: Is it in `<type>_class<x>` form ? + # Stage 3: Is it in verbose `<type> Suit` form ? return name def suitloadout_store_from_event(self, entry) -> Tuple[int, int]: