mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:27:43 +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
|
@ -41,6 +41,10 @@ public:
|
|||
void drop_cards_on_stack(CardStack&, CardStack::MovementRule);
|
||||
void clear_moving_cards();
|
||||
|
||||
bool is_previewing_card() const { return !m_previewed_card_stack.is_null(); }
|
||||
void preview_card(CardStack&, Gfx::IntPoint click_location);
|
||||
void clear_card_preview();
|
||||
|
||||
void dump_layout() const;
|
||||
|
||||
protected:
|
||||
|
@ -53,6 +57,7 @@ private:
|
|||
|
||||
NonnullRefPtrVector<Card> m_moving_cards;
|
||||
RefPtr<CardStack> m_moving_cards_source_stack;
|
||||
RefPtr<CardStack> m_previewed_card_stack;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue