|
| 1 | +--#-package:2A504B00# -- package signature |
| 2 | +---------------------------------------------------------------------- |
| 3 | +-- This file defines advisor messages related to the NAM DLL. |
| 4 | + |
| 5 | +-- 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. |
| 6 | +nam_dll_version_expected = "1.1.0" -- needs to be updated whenever a new DLL version is released |
| 7 | + |
| 8 | +-- (When this script is first executed, the `nam_dll_version` is still `nil`, but it gets defined before the trigger conditions are evaluated.) |
| 9 | +function is_nam_dll_correct() |
| 10 | + local version = rawget(globals(), "nam_dll_version") |
| 11 | + return version ~= nil and version == nam_dll_version_expected |
| 12 | +end |
| 13 | + |
| 14 | +------------ Advice record ---- |
| 15 | +a = create_advice_transportation('2a504ba0') |
| 16 | +a.trigger = "not is_nam_dll_correct()" |
| 17 | +a.title = [[text@2a504ba0 Traffic Planners Have Lost The Plot]] |
| 18 | +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'#]] |
| 19 | +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) |
| 20 | +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) |
| 21 | +a.frequency = 90 -- days |
| 22 | +a.timeout = tuning_constants.ADVICE_TIMEOUT_SHORT |
| 23 | +a.no_timeout = 1 -- message stays active in background after closing popup, so the popup doesn't reappear every few months |
| 24 | +a.priority = tuning_constants.ADVICE_PRIORITY_URGENT |
| 25 | +a.mood = advice_moods.BAD_JOB |
| 26 | + |
| 27 | +------------ Advice record ---- |
| 28 | +-- for debugging only |
| 29 | +-- a = create_advice_transportation('2a504b90') |
| 30 | +-- a.trigger = "is_nam_dll_correct()" |
| 31 | +-- a.title = [[Debug: Traffic Planners On The Right Track]] |
| 32 | +-- a.message = [[The correct version of the NAM DLL is installed: #nam_dll_version or 'not installed'#]] |
| 33 | +-- a.once = 0 |
| 34 | +-- a.persist = 1 |
| 35 | +-- a.frequency = 90 |
| 36 | +-- a.timeout = tuning_constants.ADVICE_TIMEOUT_SHORT |
| 37 | +-- a.no_timeout = 1 |
| 38 | +-- a.priority = tuning_constants.ADVICE_PRIORITY_URGENT |
| 39 | +-- a.mood = advice_moods.GREAT_JOB |
0 commit comments