mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 09:47:34 +00:00
LibCards+Solitaire: Elevate card highlight management to the card stack
Instead of indicating which individual cards should be highlighted, card games now indicate which stack is highlighted. This lets the stack draw empty stacks with a highlight (e.g. the Foundation stack in Solitaire). If the stack is non-empty, the stack can delegate highlighting to the top-most card.
This commit is contained in:
parent
8d8fcd0d64
commit
4cbdc747ab
6 changed files with 41 additions and 28 deletions
|
@ -174,7 +174,7 @@ private:
|
|||
void create_new_animation_card();
|
||||
void set_background_fill_enabled(bool);
|
||||
void check_for_game_over();
|
||||
void clear_hovered_card();
|
||||
void clear_hovered_stack();
|
||||
|
||||
virtual void paint_event(GUI::PaintEvent&) override;
|
||||
virtual void mousedown_event(GUI::MouseEvent&) override;
|
||||
|
@ -205,7 +205,7 @@ private:
|
|||
|
||||
bool m_auto_collect { false };
|
||||
|
||||
RefPtr<Card> m_hovered_card;
|
||||
RefPtr<CardStack> m_hovered_stack;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue