mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:07:45 +00:00
Solitaire: Preview cards in a stack with the right mouse button
This commit is contained in:
parent
2a1fb77faf
commit
08ff87b3ce
1 changed files with 12 additions and 3 deletions
|
@ -257,10 +257,14 @@ void Game::mousedown_event(GUI::MouseEvent& event)
|
||||||
if (is_auto_collecting() && attempt_to_move_card_to_foundations(to_check))
|
if (is_auto_collecting() && attempt_to_move_card_to_foundations(to_check))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
pick_up_cards_from_stack(to_check, click_location, Cards::CardStack::MovementRule::Alternating);
|
if (event.button() == GUI::MouseButton::Secondary) {
|
||||||
|
preview_card(to_check, click_location);
|
||||||
|
} else {
|
||||||
|
pick_up_cards_from_stack(to_check, click_location, Cards::CardStack::MovementRule::Alternating);
|
||||||
|
m_mouse_down_location = click_location;
|
||||||
|
m_mouse_down = true;
|
||||||
|
}
|
||||||
|
|
||||||
m_mouse_down_location = click_location;
|
|
||||||
m_mouse_down = true;
|
|
||||||
start_timer_if_necessary();
|
start_timer_if_necessary();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -274,6 +278,11 @@ void Game::mouseup_event(GUI::MouseEvent& event)
|
||||||
GUI::Frame::mouseup_event(event);
|
GUI::Frame::mouseup_event(event);
|
||||||
clear_hovered_stack();
|
clear_hovered_stack();
|
||||||
|
|
||||||
|
if (is_previewing_card()) {
|
||||||
|
clear_card_preview();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_moving_cards() || m_game_over_animation || m_new_game_animation)
|
if (!is_moving_cards() || m_game_over_animation || m_new_game_animation)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue