Unit tested and playtested after moving the functions decalarations,
and definitions, adding links to play_controller::game_board from
resources.?pp, and executing find and replace commands:
git grep -lz 'find_visible_unit(' | xargs -0 perl -i'' -pE "s/find_visible_unit\(/resources::gameboard->find_visible_unit\(/g"
git grep -lz 'get_visible_unit(' | xargs -0 perl -i'' -pE "s/get_visible_unit\(/resources::gameboard->get_visible_unit\(/g"
This is the result of running this command in directory src/
find . -type f -exec sed -i 's/\(ERR.*\)\\n\"\;/\1\" << std::endl\;/g' '{}' \;
and carefully inspecting the results.
If we decided it was worth it to inline map_location ==, then
surely this is also worth it to inline null_location, as the
compiler may be able to reduce tests for == null location to
"x == ... && y == ...", without having to move to a different
compilation unit.
by fixing up bad commit eb9274bd4c78a5f9a86bc9e0bf748f701d81e6b1.
the code to drop messages older than 5 should run inside the if block,
in the scenario when there were previous message, not outside it (!)
this is intended to make linux dbus notifications a bit more useful, as it appears on my machine that the current notifications only display the messages in the most distant past...
Some relevant user-facing strings were not marked as translatable.
Caveat: the game_display::send_notification method is designed around
comparing some of the relevant strings. This means that some
functionality may not work properly if the translation language is
changed between notifications. It doesn't seem like anyone considered
this when designing the platform-neutral interface of this
functionality, though, seeing as how there's a call to
game_display::send_notification elsewhere that already uses a localized
argument.
The system tray icon tooltip and some notification headers were not
translatable, which resulted in them being hardcoded to English. Fixed
this by making them translatable.
Caveat: the game_display::send_notification method is designed around
comparing some of the relevant strings. This means that some
functionality may not work properly if the translation language is
changed between notifications. It doesn't seem like anyone considered
this when designing the platform-neutral interface of this
functionality, though, seeing as how there's a call to
game_display::send_notification elsewhere that already uses a localized
argument.
One version left the fake unit in a bad state (not on a display, but recorded
as being on one), and the other failed to keep the fake unit on a display,
even though the comments indicated it did.
With this change, the display is preserved over assignment, which is consistent
with the copy constructor and the documentation for assigning a unit to a fake.
It is not easy to preserve the fake_unit's position in the deque, and currently
no benefit in trying to, so that part of the documentation has been changed.