Rev 140 | Rev 177 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 140 | Rev 171 | ||
---|---|---|---|
Line 30... | Line 30... | ||
30 | void DialogBox_PawnPromotion_Validated (void) |
30 | void DialogBox_PawnPromotion_Validated (void) |
31 | { |
31 | { |
32 | // callback function called by the main game thread when the dialog box is validated |
32 | // callback function called by the main game thread when the dialog box is validated |
33 | 33 | ||
34 | boardmove_t *currentmove; |
34 | boardmove_t *currentmove; |
- | 35 | player_t *opposite_player; |
|
35 | 36 | ||
36 | // remember this callback is no longer to be called |
37 | // remember this callback is no longer to be called |
37 | is_dialogbox_pawnpromotion_validated = false; |
38 | is_dialogbox_pawnpromotion_validated = false; |
38 | 39 | ||
39 | currentmove = &the_board.moves[the_board.move_count - 1]; // quick access to previous move |
40 | currentmove = &the_board.moves[the_board.move_count - 1]; // quick access to previous move |
Line 51... | Line 52... | ||
51 | Move_DescribeInFEN (currentmove); |
52 | Move_DescribeInFEN (currentmove); |
52 | 53 | ||
53 | // forget the hovered and selected positions |
54 | // forget the hovered and selected positions |
54 | Board_SetSelectedAndHovered (&the_board, -1, -1, -1, -1); |
55 | Board_SetSelectedAndHovered (&the_board, -1, -1, -1, -1); |
55 | 56 | ||
- | 57 | opposite_player = Player_GetOpposite (); |
|
56 |
|
58 | opposite_player->should_wakeup = true; // tell the opposite player to wake up |
- | 59 | ||
57 | the_board.reevaluate = true; // evaluate the new board |
60 | the_board.reevaluate = true; // evaluate the new board |
58 | the_scene.update = true; // and redraw the scene |
61 | the_scene.update = true; // and redraw the scene |
59 | 62 | ||
60 | return; // finished, pawn has been promoted to the desired part type |
63 | return; // finished, pawn has been promoted to the desired part type |
61 | } |
64 | } |