[Commits] [wesnoth/wesnoth] 45d699: Usability improvement, mouse interaction.

GitHub noreply at github.com
Thu Oct 12 07:28:33 UTC 2017


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

  Changed paths:
    M src/menu_events.cpp
    M src/mouse_events.cpp
    M src/mouse_events.hpp

  Log Message:
  -----------
  Usability improvement, mouse interaction.

When the game is cluttered with units from any side, the probability
of 'landing' the mouse cursor on top of a unit after activating the
'show [best possible] enemy moves' facility (via mouse) increases
drastically. In that scenario, the slightest mouse move rewinded back
enemy units movements highlight.

After this rev, if the cursor lands on a unit, an object field gets
toggled and it prevents normal single unit movements highlight until
mouse stops hovering units. Then it gets switched back to normal
interaction.

Final form of changes largely credited to review from @CelticMinstrel,
@jyrkive and @Vultraz. Abstraction `mouse_handler::hex_hosts_unit`
devised by @CelticMinstrel. Abstraction `mouse_handler::hovered_hex`
devised by @jyrkive.

src/menu_events.cpp: Disable unit movements highlighting when mouse
landing on unit after activating 'show [best possible] enemy moves'
via mouse.

src/mouse_events.cpp: On mouse_handler construction, normal units
highlighting is allowed. If the mouse is hovering a unit, do not show
unit paths if the toggle for preventing it is active. If the mouse is
not on a unit, disable the toggle.

src/mouse_events.hpp: Add object field that will be responsible to
control prevention of unit paths highlighting when that gets judged
as improper. Add new public function for querying if a given hex is
occupied by a unit. Add new public function for returning the hex the
mouse is hovering, if any.


  Commit: 640ffe42d4a4da5b5f2283bca2482f317b4ad4da
      https://github.com/wesnoth/wesnoth/commit/640ffe42d4a4da5b5f2283bca2482f317b4ad4da
  Author: galegosimpatico <galegosimpatico at outlook.com>
  Date:   2017-10-12 (Thu, 12 Oct 2017)

  Changed paths:
    M src/mouse_events.cpp

  Log Message:
  -----------
  Adjust block indent.


Compare: https://github.com/wesnoth/wesnoth/compare/ac5592cd109f...640ffe42d4a4


More information about the Commits mailing list