The current implementation of the [music] tag sets the title after adding the track, however the title field was read only. This makes the field writable.
and implement it using wesnoth.terrain_mask.
This also fixes an issue where [terrain_mask] would not remove
removed villages from the teams villages list after [terrain_mask].
This also adds an alignment parameter to [terrain_mask].
`[terrain_mask]` had multiple unexpected behviours, see for example #3364
in parituclar `wesnoth.wml_actions.terrain_mask { x =2, y=2, mask="Ww"}`
will change the tile at (1,2) instead of (2,2), so instead of reusing
the old terrain mask code i wrote a new function that behaves as one
would expect. `wesnoth.terrain_mask` does not have a `border=` parameter
but a `is_odd` parameter that specifies that a map is in the odd format
__ __
/00\__/20\__
\__/10\__/30\
/01\__/21\__/
\__/11\__/31\
/02\__/22\__/
\__/ \__/
instead of the even map format
__ __
__/10\__/30\
/00\__/20\__/
\__/11\__/31\
/01\__/21\__/
\__/12\__/32\
\__/ \__/
(Monospaced font required to see ascii images.)
The lua function also has a lua interfacte, meaning it does not take wml
tables but normal lua tables making it easier to use from lua code.
boost::ptr_vector has some nice features, but vector<unique_ptr> is still
easier to use for most people basicially becasue people know it better.
Also boost::ptr_vector does not support move ctors and also does not
use std::unique_ptr, probably because it tries to stay compatible with
c++03 so one has to use 'ptr_vector::auto_type' with it instead which
has a different interface than std::unique_ptr
for extra safety we add code to ensure undo=no for [speak] commands to the client aswell, this is not really needed as i just added a code that sets undo=yes to the server code, but it's an advantage to be able to safely connect to older servers aswell.
previously the server would send [speak] commands that had no undo=no attributes so that the game would remove the speak command from the replay instead of the actual undoable action when undoing an action.
Turns out that a t_string doesn't automatically obtain the correct
translated value. Thus, I'll simply get it by calling
translation::dsgettext() directly. I also changed the translated string to
be used in the tab label as well.
previously both were broken:
1) 'require_scenario' was only checked if the scenario was installed
which obviously doesn't make any sense at all.
2) 'require_scenario' was read from the local scenario data instead from
the remote scenario.
3) 'require_era' was only checked when the scenario was not installed,
so people who do have an outated version of the era installed could not
join bacause it assumed require_era=yes in that case.
4) the server tried to read 'require_scenario' from the wrong wml node,
'require_scenario' is an attribute of [scenario] and not of savefile
toplevel.
fixes#3017, assuming that the error is actually casued by the
'process_gamelist_diff failed'
As process_gamelist_diff simply returns after getting an error its quite
likeley that the gamelist is then in a corrupted state so we stop
processing it until we get a fresh gamelist.
previously it would happen that for example an attribute like
`side_name=_"female^Footpads"` in side would get its translatable mark (_)
removed after the game has started. This meant that observers that enterd
the game after it started would see the literal string "female^Footpads"
in the status side overview window.
The new code marks all translatable simple_wml attributes to make sure their
translatable mark is preserved along with their textdomain. It can still
happen though that attributes will appear in the the wrong textdomain area
after simple_wml processing though because in some cases note::output
might skip over textdomain markers. It is still not as bad as string like
"female^Footpads" appearing in the ui though.
An alterntive appraoch to fix this issue would be to carefully make sure
not to change any atributes of wml tags that can also contain translatable
attributes, which would probably imply not editing the wml objects received
by the client at all and instead storing the new information (in particular
side information like is_local=yes/no) in a seperate wml object. (that would
then be sended to the clients along with the original scenario wml objects.)
fixes#1420
as said in the comment, that get_special_bool might return the wrong value, as since 5f58cd7c6d the bc_vector no longer contains disabled attacks we can just remove this code.
fixes#3324
as the ingame ui is not shown yet, [delay] would only result in showing a black screen,
Also in the case of initial lua it might result in crashes because of the threaded loadingscren, or simply because parts of the ui are not initialized yet.