Also backtracked the removal of wesnoth.get_recall_units, which is now available as wesnoth.units.find_on_recall - it's just more convenient than passing x=recall to wesnoth.units.find
Fixes: https://forums.wesnoth.org/viewtopic.php?f=21&t=48370
In the tutorial when we occupy the first village the message tells us the
village count got incremented, but in the old version it was incremented
only afterwards. Non-narrator messages were updated properly. By adding the
redraw, narrator messages triggered by capture event produce the same
result as other speakers.
(cherry-picked from commit 1ea4149a44)
This also covers handling of legacy DescriptionWML for [set_menu_item],
and tweaks its handling in the other cases (mainly [multiplayer_side]).
I added the next_dev_version constant intending to use it, but then
decided not to do so; however I left it in in case someone finds it useful.
fix code problems found by luacheck
Second iteration of the process, now handling data/lua/wml/*.lua
luacheck command used to find bugs:
luacheck ./*.lua --globals wesnoth wml --codes --ignore 542 213
Additionally, error code 211 (unused variables) could be ignored,
as using underscore convention `_` is controversial in
wesnoth ( see https://github.com/wesnoth/wesnoth/pull/2380#discussion_r162519341 )
Actual bugs found:
* items.lua, access of global `write_name` instead of local `cfg.write_name`
* kill.lua, typo `primary_unit` -> `primary`
* bad code style: global `i` instead of local `i`
(would conflict with 3-rd party code if it would use global `i`, too)
No need to deselect when it was already done.
While this is the fix for the specific complaint, it does not address the larger issue of [message] being generally slow.
Adds the keys: mirror, second_image, second_mirror. These allow a portrait to be displayed on the right and left of a message simultaneously as well as to mirror them.
This is meant to replace ~RIGHT() and also the newer ~LEFT(),
with one exception: ~RIGHT() will still be the standard way to
make a unit's portrait go on the right by default.
This is more about adding Lua API for things that should have it than porting WML tags to Lua.
The following new Lua API functions have been added to the wesnoth table:
- add_fog, remove_fog
- add_sound_source, remove_sound_source, get_sound_source
- log
- ~LEFT() does the opposite of ~RIGHT(), but takes higher priority;
use it to force an image to the left that's normally on the right
(eg female silver mage)
- image=~RIGHT() means "use normal portrait, but on the right"