[Commits] [wesnoth/wesnoth] d98d7a: Fix visual bug in the announces system.

GitHub noreply at github.com
Fri Oct 27 08:39:28 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: d98d7aa80c5c63fce78649ea0ad3271df371c04d
      https://github.com/wesnoth/wesnoth/commit/d98d7aa80c5c63fce78649ea0ad3271df371c04d
  Author: galegosimpatico <galegosimpatico at outlook.com>
  Date:   2017-10-27 (Fri, 27 Oct 2017)

  Changed paths:
    M changelog
    M src/actions/move.cpp
    M src/display.cpp
    M src/display.hpp
    M src/synced_commands.cpp

  Log Message:
  -----------
  Fix visual bug in the announces system.

Follow up 'ceba081542a4'. It is nice to remove the previously
announced message when announces are being delivered very quickly, but
maybe movement feedback announces should be exempt of that. Before
this rev, Whenever an 'Enemy unit sighted' message was being ordered
coupled with a subsequent 'press $HOTKEY to keep moving', the 'Enemy
unit sighted' message was getting discarded.

src/actions/move.cpp: Movement feedback is important, do not remove
previous messaging when announcing.

src/display.cpp: Do not remove previously announced label when so
requested.

src/display.hpp: Add a `struct` device meant to pass optional
arguments to `void announce(const std::string&, const color_t&, ...)`
instead of primitive typed optional arguments (one, `int`, was being
in use, I would have needed to add a second one, `bool`, but when
trying to do that, the `bool` value would be received by the function
as the `int` argument when not providing an explicit value for the
`int` argument (see `src/actions/move.cpp`). Given C++11, for optional
arguments, does not (to the extent of my understanding) allow
specifying the argument name on the calling place, I was forced into
adding this struct in order to jail all primitive typed optional
arguments.

src/synced_commands.cpp: Adapt to new public API in `class display`.





More information about the Commits mailing list