From a9eb4e05691feae5a417991e185dff5b459702a8 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Fri, 6 Jan 2023 16:20:06 +0100 Subject: [PATCH] Add highlight types --- src/game_tab/left_panel/board/BoardCanvas.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/game_tab/left_panel/board/BoardCanvas.cpp b/src/game_tab/left_panel/board/BoardCanvas.cpp index 7d6a27a..7bebe45 100644 --- a/src/game_tab/left_panel/board/BoardCanvas.cpp +++ b/src/game_tab/left_panel/board/BoardCanvas.cpp @@ -230,8 +230,22 @@ void BoardCanvas::DrawBoard(wxDC &dc) { sfile = 7 - sfile; } if(srank == rank && sfile==file){ + char type='a'; + if(s.size()>2) + type=s[2]; + // Default highlight (type='a' or something else not supported) dc.SetPen(wxPen(*wxWHITE, 1)); - dc.SetBrush(wxColour(255,0,0,100)); + dc.SetBrush(wxColour(255,0,0,110)); + if(type=='b') + dc.SetBrush(wxColour(0,255,0,110)); + else if(type=='c') + dc.SetBrush(wxColour(0,0,255,110)); + else if(type=='d') + dc.SetBrush(wxColour(255,0,0,50)); + else if(type=='e') + dc.SetBrush(wxColour(0,255,0,50)); + else if(type=='f') + dc.SetBrush(wxColour(0,0,255,50)); dc.DrawRectangle(wxRect(x,y,square_width,square_width)); } }