When parsing binary data in the wmlparser3 script, a temporary file is
created and opened. The problem is that the temporary file is never
closed and in subsequent functions it is reopened.
The solution is first, create a list of temporary file paths to delete at
program’s exit. In the atexit’s registered cleaning function, all the
files in this list are deleted.
Then in the function that creates the temporary file, we simply close
the file after the binary data has been written in it.
Closes#3927
Show ability of a selected unit as active/inactive with respect to
mouseover hex. For example, selecting an Elvish Ranger that stands on a
forest and highlighting a water hex should show the "ambush" ability in
gray.
No string change, since this is the text for the output of
wesnoth --help, which isn't translated.
The manpages on the other hand only mention this option as being
deprecated, not specifing the details, so there is no change neccessary.
These options are an alias to userdata-dir/path, no more, no less.
Not affecting userconfig-dir/path (maybe thus the names are deprecated).
Issue #2000 remains
This also affects line breaks. There's no point in displaying confusing
errors to the player in the off-chance that they manage to introduce
leading or trailing whitespace in the username field. The server doesn't
accept whitespace but that doesn't mean we can't try to guess what the
user really meant to do, and extra whitespace around a name is a pretty
trivial mistake to make.
The password field, on the other hand, ought to accept it since it's
possible to even have line break characters in it (as tested with
Firefox on the live phpBB registration form for forums.w.o).
In the wml parser, when a node creation spans multiple lines, the code
doesn’t take in account that one of those line can contain a
#textdomain directive.
In the method “parse_outside_strings” (line 501), the code that
processes the #textdomain directive is inside an if block that is true
only if the node creation doesn’t span across multiple lines
(self.temp_key_nodes is null).
The solution implemented is that in the method “parse_outside_strings”
(line 501), the code that check if a line starts with #textdomain is
moved from inside the block that is true only if the node creation
doesn’t span across multiple lines and put in the method scope after
the first if block that checks if the line is empty.
The wml parser, when parsing the outside of a string that is
translatable, only assumed “spaces” characters could precede it. If
there are “tabs” characters the code parses the “_” character as an
attribute value.
The solution is to add a stripping code for “tabs” characters.
Code style updated based on recommendations from ProditorMagnus.
Previously `message_aging != 0` was not checked for each chat message resulting in all messages to be cleared when there is no space left.
Also when SDL_GetTicks() of the latest chatmessage returned a different value than when it was constructed the just added chatmessage was cleared aswell.
This commit also refactors to make sure SDL_GetTicks() is only called once there becasue it might be a rather slow operation (depending on plattform depended implementation).