The problem is that if we have a "#define" directive followed with an
empty line ending with a newline character then the parser presumes the
value is the newline character instead of the actual value (which is
located on a subsequent line).
The solution is that when parsing an empty line, if "self.in_string" is
False and "self.temp_key_nodes" is not None then we ignore the line
instead of parsing it with the "parse_outside_strings" function.
Closes#3947
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.
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.