1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:27:35 +00:00

Chess+GameSettings: Optionally highlight the king when in check

When either king is in check, its square is now highlighted with a red
background. This behavior can be toggled in GameSettings.
This commit is contained in:
Tim Ledbetter 2023-05-09 20:01:47 +01:00 committed by Sam Atkins
parent 0c26717ba3
commit cf4a43e4c0
6 changed files with 37 additions and 2 deletions

View file

@ -89,6 +89,9 @@ public:
void set_coordinates(bool coordinates) { m_coordinates = coordinates; }
bool coordinates() const { return m_coordinates; }
void set_highlight_checks(bool highlight_checks) { m_highlight_checks = highlight_checks; }
bool highlight_checks() const { return m_highlight_checks; }
struct BoardMarking {
Chess::Square from { 50, 50 };
Chess::Square to { 50, 50 };
@ -146,4 +149,5 @@ private:
Vector<Chess::Square> m_available_moves;
RefPtr<Engine> m_engine;
bool m_coordinates { true };
bool m_highlight_checks { true };
};