lichess-org / flutter-chessground

Chessboard package for flutter
https://pub.dev/packages/chessground
GNU General Public License v3.0
46 stars 29 forks source link

Add support for horsey theme #13

Closed csdodd closed 1 year ago

csdodd commented 1 year ago

Fixes #5

The horsey theme uses images for square highlights as oppose to solid colors. This change introduces a new structure called HighlightDetails that allows for a theme to specify if it wishes to highlight using a solid color or an image.

When rendering, if an image is present, it will take precedent over a solid color.

Screenshot_20230509_101440

csdodd commented 1 year ago

There is one bug that this introduces.

GIVEN the user is using the horsey theme AND the opponent has moved a piece that can be taken WHEN the user selects the piece that will take their opponents piece THEN the last move background image should not be visible

Here is a screenshot of the bug -- the image background should be removed when the piece can be taken.

Screenshot_20230509_102009

It's a little tricky to fix this since there a whole render pipeline inside a stack so messing with the logic needs to be done carefully -- so I have opted to not fix this issue in this PR.

veloce commented 1 year ago

Not necessarily a bug I would say. I'd leave it like that. Also I think it is currently the same result whether you choose horsey theme or not, isn't it?

csdodd commented 1 year ago

I think it is currently the same result whether you choose horsey theme or not, isn't it?

Good point -- just checked and you are correct. This bug is present in all themes.