mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 11:27:34 +00:00
LibCards: Support "previewing" cards that may be covered by other cards
For example, in Solitaire, the vertical normal stacks cover the suit of all but the topmost card in the stack. To see the suit of covered cards the user currently has to move the cards on top of them out of the way. This adds an API for games to set a card at a location to be previewed, which will draw that card on top of all other cards without moving it.
This commit is contained in:
parent
c0bc3b9814
commit
2a1fb77faf
5 changed files with 67 additions and 0 deletions
|
@ -50,6 +50,10 @@ public:
|
|||
|
||||
bool is_allowed_to_push(Card const&, size_t stack_size = 1, MovementRule movement_rule = MovementRule::Alternating) const;
|
||||
void add_all_grabbed_cards(Gfx::IntPoint click_location, NonnullRefPtrVector<Card>& grabbed, MovementRule movement_rule = MovementRule::Alternating);
|
||||
|
||||
bool preview_card(Gfx::IntPoint click_location);
|
||||
void clear_card_preview();
|
||||
|
||||
void paint(GUI::Painter&, Gfx::Color background_color);
|
||||
void clear();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue