wml.fire now supports the same syntax - both of the following work:
- wml.fire("message", {message = "Hello World"})
- wml.fire.message{message = "Hello World"}
Instead of this:
for i,t in ipairs(cfg) do
if t[1] == 'foo' then
do_something(t[2])
end
end
You can now write this:
for i,t in ipairs(cfg) do
if t.tag == 'foo' then
do_something(t.value)
end
end
Prior to this, if any .po file included a \v (vertical tab), then the game
exited before reaching the title screen. It didn't have to be in a mainline
translation - any add-on could break the game, and would do so before the title
screen appeared, thus preventing the user from using the add-on manager or
language selection to avoid the problem.
Instead, treat a parsing error similarly to the .po file simply not existing.
Fixes#5923.
The edge-case of calling evaluate_single within an unsynced event was
surprising, and I'm not sure it's correct. However, as we're about to
release the 1.16 branch I think it's better to include that as a test
that the API doesn't change during the stable branch.
Bug #5923 is that a broken .po file can make Wesnoth fail to start, not
even reaching the title screen. Additionally, the error message printed
to the console just said "*timestamp* error general:", and then missed
the details of what had broken.
This commit fixes the error message to show which add-on and which line
are causing the problem.
This is the real cause of the breakage in 5a9c24c4e79d624e34aa475949a4aa49b1984322 and d04bd2bf5d2ad932ca9bb3203f4ff9f91411e261.
A returned location now has both x/y and 1/2, so the location_set logic removed the x/y but kept the 1/2, causing it to break when converted to a config.
This makes it use rawget when the value is a table, which fixes it.
Sorting import statements was made easier and less error-prone using [isort](https://pypi.org/project/isort/)
Make it clear that the `yaml` package is not part of Python's Standard Library and should be installed with a package manager as outlined in [this](https://pep8.org/#imports) section of PEP8.
- Used constexpr if instead of SFINAE for the default getter functions
- Added support for menu buttons in the default getter function
- Fixes potentially calling get_value_label on classes derived from integer_selector other than slider
(this function is a member of the slider class)
- Made value getters take a const reference (we don't want to be able to modify widgets here)
- Made value getters return a t_string (avoids conversion to std::string and set_label takes a t_string anyway)