Make the mouse handler respect linger mode instead of assuming false.

Fixes bug #21450, restoring functionality lost in commit
7e46df9191.
This commit is contained in:
JaMiT 2014-02-23 02:07:05 -06:00
parent 4ae8e5fe3d
commit 3b69ba802b
5 changed files with 11 additions and 9 deletions

View file

@ -3,6 +3,8 @@ Version 1.11.10+dev:
* Updated translations:
* WML engine:
* Bug #21643: Removing fog from a single hex no longer makes the hex ugly.
* Miscellaneous and bug fixes:
* Units can no longer be moved in linger mode (bug #21450).
Version 1.11.10:
* Add-ons client:

View file

@ -5,6 +5,8 @@ changelog: https://github.com/wesnoth/wesnoth-old/blob/master/changelog
Version 1.11.10+dev:
* Language and i18n:
* Updated translations:
* Miscellaneous and bug fixes:
* Units can no longer be moved in linger mode (bug #21450).
Version 1.11.10:

View file

@ -493,7 +493,7 @@ void mouse_handler::mouse_wheel_right(int /*x*/, int /*y*/, const bool /*browse*
resources::controller->set_button_state(*gui_);
}
void mouse_handler::select_or_action()
void mouse_handler::select_or_action(bool browse)
{
if (!resources::game_map->on_board(last_hex_))
return;
@ -505,13 +505,11 @@ void mouse_handler::select_or_action()
|| ((selected_u != resources::units->end() && selected_u->side() != side_num_ && clicked_u != resources::units->end())) )
select_hex(last_hex_, false);
else
move_action();
move_action(browse);
}
void mouse_handler::move_action()
void mouse_handler::move_action(bool browse)
{
bool browse = false;
// Lock whiteboard activation state to avoid problems due to
// its changing while an animation takes place.
wb::whiteboard_lock wb_lock = resources::whiteboard->get_activation_state_lock();

View file

@ -73,9 +73,9 @@ public:
const bool highlight = true,
const bool fire_event = true);
void move_action();
void move_action(bool browse);
void select_or_action();
void select_or_action(bool browse);
void left_mouse_up(int x, int y, const bool /*browse*/);
void mouse_wheel_up(int x, int y, const bool /*browse*/);

View file

@ -461,11 +461,11 @@ void play_controller::left_mouse_click(){
}
void play_controller::select_and_action() {
mouse_handler_.select_or_action();
mouse_handler_.select_or_action(browse_);
}
void play_controller::move_action(){
mouse_handler_.move_action();
mouse_handler_.move_action(browse_);
}
void play_controller::deselect_hex(){