Commit graph

83373 commits

Author SHA1 Message Date
Jonathan-Kelly
37150b4e22 WoF S11: fix wmllint error by reorganizing side 2
Since wmllint gets confused if a side's contained [ai] block comes after any of its contained [unit] blocks. This refactor should make the side 2 code block more human readable too.
2024-03-05 17:04:33 +01:00
Iris Morelle
db30ca53ae
gui/outro: New clock-based timing logic for the text fading (#8454)
This version uses SDL_GetTicks() as a monotonic source to avoid the
previous version's pitfalls, namely the fact that the game's framerate
may not necessarily be a constant, and in particular, the old code
assumed a completely different framerate than what we ended up with
after the texture-based rendering changes in 1.17.x, resulting in an
almost-unnoticeable text fade due to the update() function being
called WAY more often than before.

Note that the reliance on SDL_GetTicks() means the timings break
at some point after 49 days of game runtime, exactly once. This
should result in a visible "jitter" effect if the 32-bits ticks value
wraps around in the middle of a fade sequence, but other than that
it's not that big of a deal to warrant requiring SDL 2.0.18+ for the
64-bit version.

I for one hope players wouldn't be running Wesnoth for that long
anyway. The game isn't exciting enough to justify it.
2024-03-05 08:21:55 +01:00
Steve Cotton
43dd442a4f update German translation 2024-03-04 16:14:30 +01:00
Steve Cotton
4fc7906f3e updated German translation 2024-03-03 14:32:35 +01:00
Nils Kneuper
60a9ac8f6d updated British English translation 2024-03-03 09:17:56 +01:00
pentarctagon
95bf03f357 pot update 2024-03-02 16:46:47 -06:00
Nils Kneuper
9153d704ae updated Japanese translation 2024-03-02 23:42:41 +01:00
Steve Cotton
fa353495d3 Mark a translated string as fuzzy
The markup in it isn't parsing, which is causing CI builds to fail.
2024-03-02 21:13:20 +01:00
Nils Kneuper
0fdd140b62 updated Japanese translation 2024-03-02 14:51:21 +01:00
Nils Kneuper
660c982f1e updated French translation 2024-03-02 14:49:56 +01:00
Nils Kneuper
caac0c0b83 updated Spanish translation 2024-03-02 14:48:48 +01:00
Jonathan-Kelly
bac29601fa WoF: add wmllint 'skip-side' magic comments 2024-03-01 20:08:16 -05:00
Jonathan-Kelly
827b3950e8 WoF: fix wrongly capitalized variable name 2024-03-01 20:08:16 -05:00
Steve Cotton
fb758041ca Use missing_mandatory_wml_tag instead of extra translatable strings
The logic is that the strings included the names of WML tags, but
weren't clear that they were WML tags, and so the tag names are
being translated.

This reverts almost all of the string changes of PR #7600, which
were in commit f5be4cffb7, as well
as a few similar strings which weren't in 1.16.x.
2024-03-02 00:04:32 +01:00
Steve Cotton
8660561ad9 Multiplayer: Add a po hint about "Matchmaking" 2024-03-01 22:38:35 +01:00
Steve Cotton
7ac222916a DM S18: Add a po hint about grammatical tense of some text 2024-03-01 22:36:37 +01:00
pentarctagon
f620e21c12 The method is static, but these variables can't be.
static variables are only initialized the first time they are encountered, even if they are only defined in the body of the method. therefore their value here is set to the first language used when this method is called, but won't change later if the language changes because they've already been initialized.

Fixes #8393

(cherry picked from commit ef972bb0a0)
2024-03-01 14:08:07 +01:00
pentarctagon
79973dc787 more copyright updates 2024-02-29 09:47:47 -06:00
Celtic Minstrel
612224c54e [LuaDoc] Use an alias for a sync function and declare every possible call form with @overload instead of specifying optional parameters 2024-02-29 09:18:42 -05:00
Celtic Minstrel
b71b97b468 [LuaDoc] Declare terrain_map index-by-location operator 2024-02-29 09:18:39 -05:00
Steve Cotton
2c01b8e69b Update German translation
wesnoth-lib and wesnoth-editor from Sobek
2024-02-29 14:47:27 +01:00
pentarctagon
1d693d324c add graph 2024-02-29 00:00:58 -06:00
Wedge009
718b3e5c68 Set gold laurel first in case of only one difficulty setting.
Also use dense formatting as per existing code.

(cherry picked from commit 1c78750176)
2024-02-28 14:07:41 +11:00
Wedge009
45b8e936ca Remove spurious if condition.
(cherry picked from commit c25321b713)
2024-02-28 14:07:41 +11:00
Wedge009
13c0fa6391 Keep laurel decorations consistent with difficulty level (resolves #8442).
(cherry picked from commit a84561390a)
2024-02-28 14:07:41 +11:00
pentarctagon
b853e9e10c update text post logging fix 2024-02-27 10:41:53 -06:00
newfrenchy83
4ed1d509dc
update list of boost headers used in compilation 2024-02-27 16:40:11 +01:00
pentarctagon
a32a698ca2 and backport this.. 2024-02-26 12:31:36 -06:00
Celtic Minstrel
bbe353c8dd [Lua] Fix obviously broken functions in ai_helper.
These functions are not used anywhere, and they have other issues besides the one fixed in this commit – they're implied to return all moves, but they only return one move for each possibly destination hex. However, this will make them at least be minimally usable.
2024-02-26 13:19:55 -05:00
Celtic Minstrel
7a83817989 [Lua] Remove nonexistent parameter 2024-02-26 13:19:55 -05:00
Celtic Minstrel
da12e97bca [Lua] Suppress nodiscard warning 2024-02-26 13:19:55 -05:00
Celtic Minstrel
652f98792e [Lua] Fix incorrect function name 2024-02-26 13:19:55 -05:00
Celtic Minstrel
3ac99d1d86 [Lua] Fix missing parameter warning when passing empty filter 2024-02-26 13:19:55 -05:00
Celtic Minstrel
7f5c687196 [Lua] Avoid reusing no-longer-needed variables for different meanings
This raises Lua warnings about mismatched types
2024-02-26 13:19:55 -05:00
Celtic Minstrel
a9e4a3cce8 [Lua] Fix call of nonexistent function 2024-02-26 13:19:55 -05:00
Rafael Fillipe Silva
92b8a8cb00 add scons rules do detect boost-graph
Signed-off-by: Rafael Fillipe Silva <rfsc.mori@gmail.com>
2024-02-26 10:17:20 -06:00
Rafael Fillipe Silva
3110a1762c add boost-graph dependency to codeql workflow
Signed-off-by: Rafael Fillipe Silva <rfsc.mori@gmail.com>
2024-02-26 10:17:11 -06:00
Rafael Fillipe Silva
510167b26c add tests for link cycle validation
Signed-off-by: Rafael Fillipe Silva <rfsc.mori@gmail.com>
2024-02-26 10:17:04 -06:00
Rafael Fillipe Silva
41dfd886c7 implement cycle detection for type aliases (links)
Since the detection happens after loading the config tree, it is necessary to expose the links and subtypes of the types alias and composite, respectively.

This implementation builds a graph of all links to detect cycles, ignoring all other types.

To handle links in elements of lists, all subtypes of composite types are visited, keeping the type name of the parent composite type.

Signed-off-by: Rafael Fillipe Silva <rfsc.mori@gmail.com>
2024-02-26 10:16:58 -06:00
Rafael Fillipe Silva
b7797864d6 format changes related super mandatory keys validation with clang-format 2024-02-26 10:16:49 -06:00
Rafael Fillipe Silva
4738455f14 add tests for mandatory key validations considering super tags 2024-02-26 10:16:42 -06:00
Rafael Fillipe Silva
7a769a9d2c verify if all mandatory keys are specified, including the ones from the super tags
This pattern presents the same infinite loop issue as the find_key and find_tag calls on wml_tag. The solution is the same, to use a helper to keep track of the already seen tags and stop when a cycle is detected.
2024-02-26 10:16:35 -06:00
Rafael Fillipe Silva
40fad78f5c add tests to missing super detection 2024-02-26 10:16:28 -06:00
Rafael Fillipe Silva
8f856bf05d detect when a super defined in the schema doesn't exist
Note that this is only detected if the tag referencing the missing super is used in a .cfg file. The super element itself doesn't need to be used for the detection to work.

The schema self validator should already catch this, but it deserves a warning of its own as the schema self validator can be disabled.
2024-02-26 10:16:20 -06:00
Rafael Fillipe Silva
5b0d72c9ca add tests to cover super cycle detection while validating a .cfg file 2024-02-26 10:16:13 -06:00
Rafael Fillipe Silva
e419eb903c detect schema super cycles while validating a .cfg file
Note that if the .cfg file does not use the tags that causes a cycle, those won't be detected.

This change exposes the super_refs_ so the schema validator does not need to reinvent wml_tag::expand when detecting super cycles.

The super dependency graph is built during the validation of each tag, finishing and reporting cycles at the end of the root tag.
2024-02-26 10:16:06 -06:00
Rafael Fillipe Silva
d13c2cc47a add the super's full path to the tag's super_list
This allows for better diagonistic when the specified super doesn't exist and when super cycles are detected.
2024-02-26 10:15:59 -06:00
Rafael Fillipe Silva
52b7c2e428 add a test to cover the fix to find_key's infinite loop/crash
Adds a test with a schema example containing a super cycle and a .cfg file containing an unknown key to this schema. Previously, this would cause an infinite loop or crash. Now an exception for invalid key should be thrown.
2024-02-26 10:15:52 -06:00
Rafael Fillipe Silva
ae13828cfd handle super cycles while searching for a key or for a tag
A super cycle may be found during the validation, leading to an infinite loop. For example, calling find_key on an unknown key defined in the .cfg file may trigger this behavior if a cycle exists.

To handle this, a new version of these functions was introduced, keeping the original in the class' private scope. During the search there is a bookkeeping helper that will cause the routine to return nullptr if the search goes back to the initial tag context.
2024-02-26 10:15:45 -06:00
Rafael Fillipe Silva
dd1d7e3ca7 fix wml_tag::iterator CRTP parameter
Forwards the Map type parameter instead of defaulting to `std::map<string, T>`.
2024-02-26 10:15:37 -06:00