aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/left_panel/GameTabLeftPanel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game_tab/left_panel/GameTabLeftPanel.cpp')
-rw-r--r--src/game_tab/left_panel/GameTabLeftPanel.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/game_tab/left_panel/GameTabLeftPanel.cpp b/src/game_tab/left_panel/GameTabLeftPanel.cpp
index e986653..1142e99 100644
--- a/src/game_tab/left_panel/GameTabLeftPanel.cpp
+++ b/src/game_tab/left_panel/GameTabLeftPanel.cpp
@@ -21,7 +21,6 @@ GameTabLeftPanel::GameTabLeftPanel(wxFrame *parent, std::shared_ptr<Game> game)
// Configure FEN field
fen_text_field->SetFont(wxFont(*wxNORMAL_FONT).Bold().Larger());
- last_move=game->GetCurrentMove();
// Bind events:
Bind(PLAY_MOVE_EVENT, &GameTabLeftPanel::OnPlay, this, wxID_ANY);
@@ -68,6 +67,7 @@ void GameTabLeftPanel::OnPlay(wxCommandEvent &event) {
event.SetEventObject(this);
ProcessEvent(event);
}
+ Notify(true);
}
void GameTabLeftPanel::Notify(bool skip_animation) {
@@ -78,12 +78,13 @@ void GameTabLeftPanel::Notify(bool skip_animation) {
bool animate=false;
HalfMove *m = game->GetCurrentMove();
std::string src,dst;
- if (m)
+ if (m){
captures = m->GetLineCaptures();
+ }
// Update board canvas:
- if(!skip_animation || animate){
+ if(skip_animation || !animate){
board_canvas->SetupBoard(chessarbiter::FENParser::Parse(fen).board,
game->IsBlackToPlay(), captures,
game->GetTag("White"),game->GetTag("Black"));
@@ -92,8 +93,6 @@ void GameTabLeftPanel::Notify(bool skip_animation) {
board_canvas->Animate(chessarbiter::FENParser::Parse(fen).board,
game->IsBlackToPlay(), captures,src,dst,repeat);
}
- // Update last move
- last_move=m;
// Update fen field:
fen_text_field->SetValue(game->GetFen());
}