From 33881150e9594204326f7d2c422d8d4d48ff7b8d Mon Sep 17 00:00:00 2001 From: memo Date: Sun, 13 Jul 2025 13:42:39 +0200 Subject: [PATCH 1/2] add Lua file to show advisor message about DLL version incompatibility This uses the new Lua global variable `nam_dll_version`, added in https://github.com/NAMTeam/nam-dll/pull/3 --- Controller/INRULs/RULConfig.txt | 8 ++++++ ltext/buttons.pot | 17 ++++++++++++ ltext/de/buttons.po | 26 ++++++++++++++++++ lua/adv_nam_dll.lua | 39 +++++++++++++++++++++++++++ lua/adv_nam_dll.lua.TGI | 3 +++ src/scripts/compile-release-inruls.sh | 3 +++ 6 files changed, 96 insertions(+) create mode 100644 lua/adv_nam_dll.lua create mode 100644 lua/adv_nam_dll.lua.TGI diff --git a/Controller/INRULs/RULConfig.txt b/Controller/INRULs/RULConfig.txt index 2169027f4..b0fa2737e 100644 --- a/Controller/INRULs/RULConfig.txt +++ b/Controller/INRULs/RULConfig.txt @@ -333,3 +333,11 @@ Source: AvenueAdvanced/WideRadiusCurves.rul Source: AvenueAdvanced/Roundabouts.rul Source: AvenueAdvanced/TurningLanes.rul Source: AvenueAdvanced/Intersections.rul + +######################################################## + +File: NetworkAddonMod_Advice.dat + +TGI: 0xCA63E2A3 0x4A5E8EF6 0x2A504B00 +Compressed: 1 +Source: ../../lua/adv_nam_dll.lua diff --git a/ltext/buttons.pot b/ltext/buttons.pot index 7b2f70809..2a6e68cc6 100644 --- a/ltext/buttons.pot +++ b/ltext/buttons.pot @@ -1441,4 +1441,21 @@ msgstr "" msgctxt "2026960B-EA5524EB-CBE09C9B" msgid "RHW" +msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA0" +msgid "Traffic Planners Have Lost The Plot" +msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA1" +msgid "" +"

\n" +"Mayor! It seems our traffic engineers have been taking a wrong turn with the data they received, resulting in some peculiar roadways and puzzling intersections that resemble modern art rather than functional pathways—proof that when you feed the wrong info, even the best engineers can get off track:\n" +"

\n" +"They could not find the correct NAM DLL file in your Plugins.\n" +"

\n" +"Required NAM DLL version: #nam_dll_version_expected#\n" +"
\n" +"Installed NAM DLL version: #nam_dll_version or 'not installed'#\n" +"

" msgstr "" \ No newline at end of file diff --git a/ltext/de/buttons.po b/ltext/de/buttons.po index 33a8fb9aa..d2b2f785c 100644 --- a/ltext/de/buttons.po +++ b/ltext/de/buttons.po @@ -1487,3 +1487,29 @@ msgstr "" msgctxt "2026960B-EA5524EB-CBE09C9B" msgid "RHW" msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA0" +msgid "Traffic Planners Have Lost The Plot" +msgstr "Verkehrsplaner haben keinen Plan" + +msgctxt "2026960B-6A231EA4-2A504BA1" +msgid "" +"

\n" +"Mayor! It seems our traffic engineers have been taking a wrong turn with the data they received, resulting in some peculiar roadways and puzzling intersections that resemble modern art rather than functional pathways—proof that when you feed the wrong info, even the best engineers can get off track:\n" +"

\n" +"They could not find the correct NAM DLL file in your Plugins.\n" +"

\n" +"Required NAM DLL version: #nam_dll_version_expected#\n" +"
\n" +"Installed NAM DLL version: #nam_dll_version or 'not installed'#\n" +"

" +msgstr "" +"

\n" +"Hoppla! Es scheint, als hätten unsere Verkehrsingenieure den falschen Weg eingeschlagen. Die vorliegenden Daten zeigen bizarre Straßenmuster und verwirrende Kreuzungen, die eher wie moderne Kunstwerke aussehen statt funktionaler Wege – ein Beweis dafür, dass mit den falschen Infos selbst die besten Baumeister vom Pfad abkommen:\n" +"

\n" +"Ihr Plugins-Ordner enthält nicht die richtige NAM-DLL-Datei." +"

\n" +"Benötigte NAM-DLL-Version: #nam_dll_version_expected#\n" +"
\n" +"Installierte NAM-DLL-Version: #nam_dll_version or 'nicht installiert'#\n" +"

" diff --git a/lua/adv_nam_dll.lua b/lua/adv_nam_dll.lua new file mode 100644 index 000000000..e64de1c98 --- /dev/null +++ b/lua/adv_nam_dll.lua @@ -0,0 +1,39 @@ +--#-package:2A504B00# -- package signature +---------------------------------------------------------------------- +-- This file defines advisor messages related to the NAM DLL. + +-- Note that this Lua file is not intended for distribution with the DLL itself, but for distribution with the NAM DBPF files to ensure compatibility between NAM and DLL. +nam_dll_version_expected = "1.1.0" -- needs to be updated whenever a new DLL version is released + +-- (When this script is first executed, the `nam_dll_version` is still `nil`, but it gets defined before the trigger conditions are evaluated.) +function is_nam_dll_correct() + local version = rawget(globals(), "nam_dll_version") + return version ~= nil and version == nam_dll_version_expected +end + +------------ Advice record ---- +a = create_advice_transportation('2a504ba0') +a.trigger = "not is_nam_dll_correct()" +a.title = [[text@2a504ba0 Traffic Planners Have Lost The Plot]] +a.message = [[text@2a504ba1 They could not find the correct NAM DLL file in your Plugins. Required NAM DLL version: #nam_dll_version_expected#, Installed NAM DLL version: #nam_dll_version or 'not installed'#]] +a.once = 0 -- must be 0, since 1 means once per city (saving after closing the message would prevent message from ever appearing again, even after restarting the game or upgrading to a newer DLL version – unless the GUID is changed for every new DLL version) +a.persist = 1 -- irrelevant as trigger is not random (after game is restarted with correct DLL, the trigger seems to be evaluated anyway, so message disappears) +a.frequency = 90 -- days +a.timeout = tuning_constants.ADVICE_TIMEOUT_SHORT +a.no_timeout = 1 -- message stays active in background after closing popup, so the popup doesn't reappear every few months +a.priority = tuning_constants.ADVICE_PRIORITY_URGENT +a.mood = advice_moods.BAD_JOB + +------------ Advice record ---- +-- for debugging only +-- a = create_advice_transportation('2a504b90') +-- a.trigger = "is_nam_dll_correct()" +-- a.title = [[Debug: Traffic Planners On The Right Track]] +-- a.message = [[The correct version of the NAM DLL is installed: #nam_dll_version or 'not installed'#]] +-- a.once = 0 +-- a.persist = 1 +-- a.frequency = 90 +-- a.timeout = tuning_constants.ADVICE_TIMEOUT_SHORT +-- a.no_timeout = 1 +-- a.priority = tuning_constants.ADVICE_PRIORITY_URGENT +-- a.mood = advice_moods.GREAT_JOB diff --git a/lua/adv_nam_dll.lua.TGI b/lua/adv_nam_dll.lua.TGI new file mode 100644 index 000000000..35f44c7e1 --- /dev/null +++ b/lua/adv_nam_dll.lua.TGI @@ -0,0 +1,3 @@ +CA63E2A3 +4A5E8EF6 +2A504B00 diff --git a/src/scripts/compile-release-inruls.sh b/src/scripts/compile-release-inruls.sh index 32fe39db5..ac381af51 100755 --- a/src/scripts/compile-release-inruls.sh +++ b/src/scripts/compile-release-inruls.sh @@ -55,4 +55,7 @@ cp -p "$PROJECT_ROOT/Controller/INRULs/NetworkAddonMod_IndividualNetworkRULs_LHD # Avenue turning lanes cp -p "$PROJECT_ROOT/Controller/INRULs/NetworkAddonMod_TurningLanes_Avenues_Plugin_INRULs.dat" "target/controllers/" +# advisor messages +cp -p "$PROJECT_ROOT/Controller/INRULs/NetworkAddonMod_Advice.dat" "target/controllers/" + rm -rf "$TEMP" From b3d556e9b7ce7b0e84dbc5d382a6b75318d5eb57 Mon Sep 17 00:00:00 2001 From: memo Date: Sun, 13 Jul 2025 13:47:04 +0200 Subject: [PATCH 2/2] synchronize .po files --- ltext/de/puzzlepieces-RHW.po | 4 ++-- ltext/es/buttons.po | 17 +++++++++++++++++ ltext/fr/buttons.po | 34 +++++++++++++++++++++++----------- ltext/it/buttons.po | 17 +++++++++++++++++ ltext/ja/buttons.po | 17 +++++++++++++++++ ltext/ko/buttons.po | 17 +++++++++++++++++ ltext/nl/buttons.po | 17 +++++++++++++++++ ltext/pt/buttons.po | 17 +++++++++++++++++ ltext/sv/buttons.po | 17 +++++++++++++++++ 9 files changed, 144 insertions(+), 13 deletions(-) diff --git a/ltext/de/puzzlepieces-RHW.po b/ltext/de/puzzlepieces-RHW.po index 67277c5ab..43133e2ce 100644 --- a/ltext/de/puzzlepieces-RHW.po +++ b/ltext/de/puzzlepieces-RHW.po @@ -387,7 +387,7 @@ msgctxt "2026960B-2A592FD1-5780000F" msgid "" "FLEXRamp Type A1\n" "\n" -"Supports RHW-2 (L0-L2), RHW-3 (L0-L1), MIS (L0-L4), RHW-4 (L0-L4 and DDRHW-4), RHW-6S (L0 Only due to overhang), RHW-6C (L0-L2), RHW-8S (L0-L2), RHW-8C (L0-L2), RHW-10S (L0-L2), RHW-12S (L0-L2)" +"Supports RHW-2 (L0-L2), RHW-3 (L0-L2), MIS (L0-L4), RHW-4 (L0-L4 and DDRHW-4), RHW-6S (L0 Only due to overhang), RHW-6C (L0-L2), RHW-8S (L0-L2), RHW-8C (L0-L2), RHW-10S (L0-L2), RHW-12S (L0-L2)" msgstr "" msgctxt "2026960B-2A592FD1-5780001F" @@ -590,7 +590,7 @@ msgctxt "2026960B-2A592FD1-5780100F" msgid "" "FLEXRamp Type B1\n" "\n" -"Supports RHW-2 (L0-L2), RHW-3 (L0-L1), MIS (L0-L4), RHW-4 (L0-L4 and DDRHW-4), RHW-6S (L0-L4), RHW-6C (L0-L2), RHW-8S (L0-L2), RHW-8C (L0-L2), RHW-10S (L0-L2), RHW-12S (L0-L2)" +"Supports RHW-2 (L0-L2), RHW-3 (L0-L2), MIS (L0-L4), RHW-4 (L0-L4 and DDRHW-4), RHW-6S (L0-L4), RHW-6C (L0-L2), RHW-8S (L0-L2), RHW-8C (L0-L2), RHW-10S (L0-L2), RHW-12S (L0-L2)" msgstr "" msgctxt "2026960B-2A592FD1-5780200F" diff --git a/ltext/es/buttons.po b/ltext/es/buttons.po index 86d1573e9..f54d27d41 100644 --- a/ltext/es/buttons.po +++ b/ltext/es/buttons.po @@ -1514,3 +1514,20 @@ msgstr "" msgctxt "2026960B-EA5524EB-CBE09C9B" msgid "RHW" msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA0" +msgid "Traffic Planners Have Lost The Plot" +msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA1" +msgid "" +"

\n" +"Mayor! It seems our traffic engineers have been taking a wrong turn with the data they received, resulting in some peculiar roadways and puzzling intersections that resemble modern art rather than functional pathways—proof that when you feed the wrong info, even the best engineers can get off track:\n" +"

\n" +"They could not find the correct NAM DLL file in your Plugins.\n" +"

\n" +"Required NAM DLL version: #nam_dll_version_expected#\n" +"
\n" +"Installed NAM DLL version: #nam_dll_version or 'not installed'#\n" +"

" +msgstr "" diff --git a/ltext/fr/buttons.po b/ltext/fr/buttons.po index 13dd0ebda..66cb33b02 100644 --- a/ltext/fr/buttons.po +++ b/ltext/fr/buttons.po @@ -95,8 +95,7 @@ msgctxt "2026960B-123006AA-6A470460" msgid "" "For building FLEX Turn Lanes (FTLs)\n" "\n" -"Button contains FLEX Turn Lane starters and FLEX intersections for various road networks" -"\n" +"Button contains FLEX Turn Lane starters and FLEX intersections for various road networks\n" "Drag the listed network through the FLEX/Starter Piece to construct the turn lane." msgstr "" "Cet outil contient les Pièces-Initiales pour construire des voies médianes et intersections FLEX pour les diverses Routes.\n" @@ -187,8 +186,7 @@ msgctxt "2026960B-123006AA-6A475000" msgid "" "For building RealHighway Starter Pieces\n" "\n" -"Button contains Starter Pieces to build RHW networks of varying widths and heights, up to 12 lanes (RHW-12S) and for certain networks, up to 30 meters high (L4)" -"\n" +"Button contains Starter Pieces to build RHW networks of varying widths and heights, up to 12 lanes (RHW-12S) and for certain networks, up to 30 meters high (L4)\n" "Drag the RealHighway (RHW-2) network tool through the Starter Piece to construct the desired override network." msgstr "" "L'outil contient les Pièces-Initiales pour construire des réseaux RHW de différentes largeurs et hauteurs, jusqu'à 12 voies (RHW-12S) et pour certains réseaux, jusqu'à 30 mètres de haut (L4).\n" @@ -240,8 +238,7 @@ msgid "" "\n" "These items are DEPRECATED, and the use of the FLEX Neighbor Connections is recommended instead." msgstr "" -"Cet outil contient les Pièces-Puzzles pour établir les connexions de voisinage pour les autoroutes (RHW)." -"\n" +"Cet outil contient les Pièces-Puzzles pour établir les connexions de voisinage pour les autoroutes (RHW).\n" "Ces éléments sont OBSOLÈTES et il est recommandé d'utiliser les connecteurs de voisinage FLEX." msgctxt "2026960B-123007BB-6A47508C" @@ -265,8 +262,7 @@ msgid "RealHighway FLEX Neighbor Connector Pieces (FLEX-NC)" msgstr "Connecteurs de Voisinage FLEX pour autoroute (FLEX-NC)" msgctxt "2026960B-123006AA-6A475100" -msgid "" -"For building DEPRECATED RealHighway Ramp Interfaces. All of the functionality of the 47 pieces contained and many more are covered by the FLEXRamp system." +msgid "For building DEPRECATED RealHighway Ramp Interfaces. All of the functionality of the 47 pieces contained and many more are covered by the FLEXRamp system." msgstr "" msgctxt "2026960B-123007BB-6A475100" @@ -819,8 +815,7 @@ msgid "" msgstr "" "L'outil propose des Pièces-Puzzles pour construire des passages souterrains de Routes, Sens-uniques, Avenues, Rues et Tram en voie partagée (T-RAM).\n" "\n" -"NOTE : Construisez d'abord le réseau de surface, puis placez les pièces de tracés souterrains par dessus." -"\n" +"NOTE : Construisez d'abord le réseau de surface, puis placez les pièces de tracés souterrains par dessus.\n" "Le nouveau système FLUPs basé sur le métro se trouve dans le menu Autoroutes." msgctxt "2026960B-123007BB-6A477A00" @@ -1591,4 +1586,21 @@ msgstr "El Train Control" msgctxt "2026960B-EA5524EB-CBE09C9B" msgid "RHW" -msgstr "RHW" \ No newline at end of file +msgstr "RHW" + +msgctxt "2026960B-6A231EA4-2A504BA0" +msgid "Traffic Planners Have Lost The Plot" +msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA1" +msgid "" +"

\n" +"Mayor! It seems our traffic engineers have been taking a wrong turn with the data they received, resulting in some peculiar roadways and puzzling intersections that resemble modern art rather than functional pathways—proof that when you feed the wrong info, even the best engineers can get off track:\n" +"

\n" +"They could not find the correct NAM DLL file in your Plugins.\n" +"

\n" +"Required NAM DLL version: #nam_dll_version_expected#\n" +"
\n" +"Installed NAM DLL version: #nam_dll_version or 'not installed'#\n" +"

" +msgstr "" diff --git a/ltext/it/buttons.po b/ltext/it/buttons.po index 04b7ce07a..f09ab01a7 100644 --- a/ltext/it/buttons.po +++ b/ltext/it/buttons.po @@ -1624,3 +1624,20 @@ msgstr "Controllo dei Treni della Ferrovia Sopraelevata" msgctxt "2026960B-EA5524EB-CBE09C9B" msgid "RHW" msgstr "RHW" + +msgctxt "2026960B-6A231EA4-2A504BA0" +msgid "Traffic Planners Have Lost The Plot" +msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA1" +msgid "" +"

\n" +"Mayor! It seems our traffic engineers have been taking a wrong turn with the data they received, resulting in some peculiar roadways and puzzling intersections that resemble modern art rather than functional pathways—proof that when you feed the wrong info, even the best engineers can get off track:\n" +"

\n" +"They could not find the correct NAM DLL file in your Plugins.\n" +"

\n" +"Required NAM DLL version: #nam_dll_version_expected#\n" +"
\n" +"Installed NAM DLL version: #nam_dll_version or 'not installed'#\n" +"

" +msgstr "" diff --git a/ltext/ja/buttons.po b/ltext/ja/buttons.po index 11ff2b79b..5e04843d2 100644 --- a/ltext/ja/buttons.po +++ b/ltext/ja/buttons.po @@ -1441,3 +1441,20 @@ msgstr "" msgctxt "2026960B-EA5524EB-CBE09C9B" msgid "RHW" msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA0" +msgid "Traffic Planners Have Lost The Plot" +msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA1" +msgid "" +"

\n" +"Mayor! It seems our traffic engineers have been taking a wrong turn with the data they received, resulting in some peculiar roadways and puzzling intersections that resemble modern art rather than functional pathways—proof that when you feed the wrong info, even the best engineers can get off track:\n" +"

\n" +"They could not find the correct NAM DLL file in your Plugins.\n" +"

\n" +"Required NAM DLL version: #nam_dll_version_expected#\n" +"
\n" +"Installed NAM DLL version: #nam_dll_version or 'not installed'#\n" +"

" +msgstr "" diff --git a/ltext/ko/buttons.po b/ltext/ko/buttons.po index 2c740d747..cca6a21ce 100644 --- a/ltext/ko/buttons.po +++ b/ltext/ko/buttons.po @@ -1840,3 +1840,20 @@ msgstr "El Train Control" msgctxt "2026960B-EA5524EB-CBE09C9B" msgid "RHW" msgstr "RHW" + +msgctxt "2026960B-6A231EA4-2A504BA0" +msgid "Traffic Planners Have Lost The Plot" +msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA1" +msgid "" +"

\n" +"Mayor! It seems our traffic engineers have been taking a wrong turn with the data they received, resulting in some peculiar roadways and puzzling intersections that resemble modern art rather than functional pathways—proof that when you feed the wrong info, even the best engineers can get off track:\n" +"

\n" +"They could not find the correct NAM DLL file in your Plugins.\n" +"

\n" +"Required NAM DLL version: #nam_dll_version_expected#\n" +"
\n" +"Installed NAM DLL version: #nam_dll_version or 'not installed'#\n" +"

" +msgstr "" diff --git a/ltext/nl/buttons.po b/ltext/nl/buttons.po index b5c96fff6..9e0d2cded 100644 --- a/ltext/nl/buttons.po +++ b/ltext/nl/buttons.po @@ -1449,3 +1449,20 @@ msgstr "" msgctxt "2026960B-EA5524EB-CBE09C9B" msgid "RHW" msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA0" +msgid "Traffic Planners Have Lost The Plot" +msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA1" +msgid "" +"

\n" +"Mayor! It seems our traffic engineers have been taking a wrong turn with the data they received, resulting in some peculiar roadways and puzzling intersections that resemble modern art rather than functional pathways—proof that when you feed the wrong info, even the best engineers can get off track:\n" +"

\n" +"They could not find the correct NAM DLL file in your Plugins.\n" +"

\n" +"Required NAM DLL version: #nam_dll_version_expected#\n" +"
\n" +"Installed NAM DLL version: #nam_dll_version or 'not installed'#\n" +"

" +msgstr "" diff --git a/ltext/pt/buttons.po b/ltext/pt/buttons.po index f34bd0d62..4628acc68 100644 --- a/ltext/pt/buttons.po +++ b/ltext/pt/buttons.po @@ -1441,3 +1441,20 @@ msgstr "" msgctxt "2026960B-EA5524EB-CBE09C9B" msgid "RHW" msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA0" +msgid "Traffic Planners Have Lost The Plot" +msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA1" +msgid "" +"

\n" +"Mayor! It seems our traffic engineers have been taking a wrong turn with the data they received, resulting in some peculiar roadways and puzzling intersections that resemble modern art rather than functional pathways—proof that when you feed the wrong info, even the best engineers can get off track:\n" +"

\n" +"They could not find the correct NAM DLL file in your Plugins.\n" +"

\n" +"Required NAM DLL version: #nam_dll_version_expected#\n" +"
\n" +"Installed NAM DLL version: #nam_dll_version or 'not installed'#\n" +"

" +msgstr "" diff --git a/ltext/sv/buttons.po b/ltext/sv/buttons.po index 8a517b403..4176285fe 100644 --- a/ltext/sv/buttons.po +++ b/ltext/sv/buttons.po @@ -1441,3 +1441,20 @@ msgstr "" msgctxt "2026960B-EA5524EB-CBE09C9B" msgid "RHW" msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA0" +msgid "Traffic Planners Have Lost The Plot" +msgstr "" + +msgctxt "2026960B-6A231EA4-2A504BA1" +msgid "" +"

\n" +"Mayor! It seems our traffic engineers have been taking a wrong turn with the data they received, resulting in some peculiar roadways and puzzling intersections that resemble modern art rather than functional pathways—proof that when you feed the wrong info, even the best engineers can get off track:\n" +"

\n" +"They could not find the correct NAM DLL file in your Plugins.\n" +"

\n" +"Required NAM DLL version: #nam_dll_version_expected#\n" +"
\n" +"Installed NAM DLL version: #nam_dll_version or 'not installed'#\n" +"

" +msgstr ""