Commit Graph

22 Commits

Author SHA1 Message Date
RoosterDragon
0bfa53b58d Teach CheckTranslationReference about translations in Lua scripts
Using the glory of regex, we can scrape any Lua script files that a map includes and locate calls to the UserInterface.Translate method. We can then treat them in the same way as C# fields marked with a TranslationReferenceAttribute. This allows the lint check to validate the translation invoked in the .lua script has a matching entry in the translation .ftl files, with all the required arguments (if any).

We can also locate any calls to AddPrimaryObjective or AddSecondaryObjective defined by the utils.lua script, which also accept translation keys.

The are a couple of restrictions:
- When linting the map, we don't check for keys in the ftl file that are unused. This is because the linter doesn't load all the keys when checking maps.
- In order to validate translation arguments with the regex, we require the Lua script to pass the table of arguments inline at the callsite. If it does not, we raise a warning so the user can adjust the code.
2024-07-22 17:27:58 +02:00
Matthias Mailänder
378f66a1ff Resolve Lua language server diagnosed problems. 2023-03-28 11:45:15 +02:00
Matthias Mailänder
9b2e291a46 Extract translation strings. 2023-01-23 20:51:45 +01:00
abcdefg30
5bf7fe852c Remove the copyright year numbers 2023-01-11 11:58:54 +02:00
abcdefg30
6a31b1f9f3 Update the copyright header year 2022-05-28 00:35:10 -05:00
Matthias Mailänder
b9bfbfd5ac Use global objective initialisation. 2021-11-26 23:39:41 +01:00
Matthias Mailänder
d42edfc0b9 Use global difficulty. 2021-11-26 23:39:41 +01:00
Andre Mohren
6810469634 Updated copyright years. 2021-06-29 18:33:21 -05:00
Smittytron
243dc965c0 Move IdleHunt function to campaign-global.lua 2021-05-22 23:29:42 +02:00
Smittytron
0d3c624bbc Standardize usage of AddObjective in RA missions 2021-04-11 12:26:14 +02:00
Smittytron
5b2733decf Fix lag issue on Exodus by narrowing exit area 2020-12-30 01:51:27 +00:00
Paul Chote
e5a1a8a706 Replace deprecated API usage. 2020-06-19 17:28:01 +02:00
Paul Chote
d73ed7670a Port missions to the new Paratroopers API. 2020-02-29 16:07:24 +01:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
abcdefg30
8b9603168a Change the year number in all lua headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
Jean-Rémy Buchs
fc725c6c0c add GPLv3+ header to all lua scripts 2017-04-10 21:13:51 +02:00
reaperrr
208a31470f Merge pull request #12160 from abcdefg30/hboxYak
Fix yaks trying to attack invalid targets
2016-10-14 18:55:37 +02:00
abcdefg30
d828e709d6 Fix soviet units not attack moving to their rally points
and remove unnecessary (duplicated) code from the tick function
(the call to IdleHunt inside SpawnSovietUnits is enough)
2016-10-09 22:05:41 +02:00
abcdefg30
648f06af0f Fix soviet units not stopping to hunt after being captured in Exodus 2016-10-08 21:11:24 +02:00
abcdefg30
47968aabdc Fix yaks trying to attack invalid targets 2016-10-04 10:04:59 +02:00
Matthias Mailänder
ad986b2fb4 Port the Co-Op Allies03 map to Lua. 2016-08-30 07:35:45 +02:00