The fiters restrict the events for exactly one particular unit.
Filtering the messages also by the unit id unstead of the generic "unit" variable
shows in the translation file who speaks the message - instead of the generic "unit"
shown otherwise.
[ci skip]
These changes to the data/gui subdirectories make it so that above a certain
screen pixel dimensions (currently 1200x900), text font sizes will be scaled
with the pixel pitch of the SDL video device. In addition, several dialogues
(such as the unit recall window, for example) are allowed to take on larger
pixel dimensions to accommodate the larger (in pixel size) fonts.
In order to modify the GUI2 configuration files so that text_font_size can intelligently
scale with monitor characteristics, it's necessary to allow the text_font_size,
maximum_height, and maximum_width to be specified by WFL formulas rather than just
numerical constants. This commit makes that possible. In addition, it computes and exposes
the pixel pitch of the SDL display (in microns per pixel) in the variable
screen_pitch_microns for use in these formulas.
When debugging formula problems, it is convenient to be able to pinpoint at what line in
the code an exception was thrown. This commit differentiates two divide by zero errors
to facilitate that.
Prior to this change, the 1024x768 base resolution (found in the default theme)
was hard-coded into theme.cpp; resolutions beyond that were always scaled as if they
had been defined on a 1024x768 base resolution, even if the width and height specified
in the theme file were different. Combined with the scaling arithmetic in theme.cpp,
this assumption resulted in bugs such as panels disappearing whenever their width in the
base resolution specified in the theme exceeded 1024 pixels or their height exceeded 768
pixels. This change records the base resolution from the theme in the theme and all of
its objects, so the scaling computation can be done correctly.
With GCC 9, enabling LTO no longer causes the boost unit tests to segfault and also doesn't increase the build time to the point that a full rebuild times out.
Maybe the "team_rgb_range" should be renamed as "named_color_range", because
it's used for everything defined by the WML `[color_range]` tag. In addition to
the ones normally used for teams (`red`, `lightblue`, etc) it has the minimap
colors for `reef`, `cave`, etc.
Separating the team colors from the terrain colors probably shouldn't be done.
Looking from the opposite perspective, using the terrain colors as team colors
has been discussed on the forums and found to be a useful feature:
* https://r.wesnoth.org/p627592
* https://r.wesnoth.org/p627588
There is no reason to do so since units get already
healed when advancing to the next scenario. Not
healing the unit gives more flexibility to wml authors
who might want the player to be able to recall injured
units by modifying the hp of a recall list unit or by using
`[put_to_recall_list] heal=no`
Furthermore this also doesn't match what is shown in the recall dialog.
Fixes#4888
Now formulas like "add=(attacker.level - defender.level)"
are possible in weapon specials that allow the author to compute
the abilities value based on the opponent. The main reason why i
choose for attacker/defender instead of self/opponent was thats
is easier to implement. (but using the self/student variable is
also possible to get a 'opponent' variable shoudl that be needed)
Also it is less ambiguous than 'self/opponent' in the case of
weapon specials that come from leadership-like abilities.