Rev 59 | Rev 116 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 59 | Rev 75 | ||
---|---|---|---|
Line 131... | Line 131... | ||
131 | DialogBox_Save (); // fire up the save dialog box |
131 | DialogBox_Save (); // fire up the save dialog box |
132 | 132 | ||
133 | // game menu, save position as |
133 | // game menu, save position as |
134 | else if (wParam_loword == MENUID_GAME_SAVEPOSITIONAS) |
134 | else if (wParam_loword == MENUID_GAME_SAVEPOSITIONAS) |
135 | DialogBox_SavePosition (); // fire up the save position dialog box |
135 | DialogBox_SavePosition (); // fire up the save position dialog box |
- | 136 | ||
- | 137 | // game menu, pause |
|
- | 138 | else if (wParam_loword == MENUID_GAME_PAUSE) |
|
- | 139 | { |
|
- | 140 | is_paused ^= true; // toggle game pause state on/off |
|
- | 141 | CheckMenuItem (GetMenu (hWnd), MENUID_GAME_PAUSE, (is_paused ? MF_CHECKED : MF_UNCHECKED)); // highlight the menu entry as necessary |
|
- | 142 | the_board.reevaluate = true; // evaluate board again |
|
- | 143 | } |
|
136 | 144 | ||
137 | // game menu, resign |
145 | // game menu, resign |
138 | else if (wParam_loword == MENUID_GAME_RESIGN) |
146 | else if (wParam_loword == MENUID_GAME_RESIGN) |
139 | DialogBox_Resign (); // if a game has started, ask for confirmation |
147 | DialogBox_Resign (); // if a game has started, ask for confirmation |
140 | 148 | ||
Line 142... | Line 150... | ||
142 | else if (wParam_loword == MENUID_GAME_STATISTICS) |
150 | else if (wParam_loword == MENUID_GAME_STATISTICS) |
143 | { |
151 | { |
144 | local_player = Player_FindByType (PLAYER_HUMAN); |
152 | local_player = Player_FindByType (PLAYER_HUMAN); |
145 | if (local_player != NULL) |
153 | if (local_player != NULL) |
146 | PlayerCard_FindOrCreate (local_player->name); // display player's own player card |
154 | PlayerCard_FindOrCreate (local_player->name); // display player's own player card |
147 | } |
155 | } |
148 | 156 | ||
149 | // game menu, options |
157 | // game menu, options |
150 | else if (wParam_loword == MENUID_GAME_OPTIONS) |
158 | else if (wParam_loword == MENUID_GAME_OPTIONS) |
151 | DialogBox_Options (); // fire up the options dialog box |
159 | DialogBox_Options (); // fire up the options dialog box |
152 | 160 | ||
Line 164... | Line 172... | ||
164 | the_board.players[current_viewer].wants_hint = true; // remember this player wants a hint |
172 | the_board.players[current_viewer].wants_hint = true; // remember this player wants a hint |
165 | 173 | ||
166 | // chessboard menu, cancel last move |
174 | // chessboard menu, cancel last move |
167 | else if (wParam_loword == MENUID_CHESSBOARD_CANCELLASTMOVE) |
175 | else if (wParam_loword == MENUID_CHESSBOARD_CANCELLASTMOVE) |
168 | the_board.players[current_viewer].wants_cancel = true; // remember this player wants to cancel his last move |
176 | the_board.players[current_viewer].wants_cancel = true; // remember this player wants to cancel his last move |
169 | 177 | ||
170 | // chessboard menu, comment move |
178 | // chessboard menu, comment move |
171 | else if (wParam_loword == MENUID_CHESSBOARD_COMMENTMOVE) |
179 | else if (wParam_loword == MENUID_CHESSBOARD_COMMENTMOVE) |
172 | DialogBox_Comment (); // fire up the comment dialog box |
180 | DialogBox_Comment (); // fire up the comment dialog box |
173 | 181 | ||
174 | // chessboard menu, go to move |
182 | // chessboard menu, go to move |
Line 176... | Line 184... | ||
176 | DialogBox_GoToMove (); // fire up the go to move dialog box |
184 | DialogBox_GoToMove (); // fire up the go to move dialog box |
177 | 185 | ||
178 | // chessboard menu, swap sides |
186 | // chessboard menu, swap sides |
179 | else if (wParam_loword == MENUID_CHESSBOARD_SWAPSIDES) |
187 | else if (wParam_loword == MENUID_CHESSBOARD_SWAPSIDES) |
180 | the_board.want_playerswap = true; // remember board sides are to be swapped |
188 | the_board.want_playerswap = true; // remember board sides are to be swapped |
- | 189 | ||
- | 190 | // chessboard menu, rename players |
|
- | 191 | else if (wParam_loword == MENUID_CHESSBOARD_RENAMESIDES) |
|
- | 192 | DialogBox_RenameSides(); // fire up the rename sides dialog box |
|
181 | 193 | ||
182 | // chessboard menu, beginning of game |
194 | // chessboard menu, beginning of game |
183 | else if (wParam_loword == MENUID_CHESSBOARD_BEGINNINGOFGAME) |
195 | else if (wParam_loword == MENUID_CHESSBOARD_BEGINNINGOFGAME) |
184 | { |
196 | { |
185 | the_board.viewed_move = 0; // enter view mode and go to the beginning of the game |
197 | the_board.viewed_move = 0; // enter view mode and go to the beginning of the game |
Line 483... | Line 495... | ||
483 | // get current player and see if we're online |
495 | // get current player and see if we're online |
484 | current_player = Player_GetCurrent (); |
496 | current_player = Player_GetCurrent (); |
485 | remote_player = Player_FindByType (PLAYER_INTERNET); |
497 | remote_player = Player_FindByType (PLAYER_INTERNET); |
486 | 498 | ||
487 | // if we are not allowed to select anything, don't even try |
499 | // if we are not allowed to select anything, don't even try |
488 | if ((current_player->type != PLAYER_HUMAN) || (the_board.viewed_move != the_board.move_count - 1) |
500 | if (is_paused || (current_player->type != PLAYER_HUMAN) || (the_board.viewed_move != the_board.move_count - 1) |
489 | || ((remote_player != NULL) && !remote_player->is_in_game)) |
501 | || ((remote_player != NULL) && !remote_player->is_in_game)) |
490 | { |
502 | { |
491 | the_scene.update = true; // update the 3D scene |
503 | the_scene.update = true; // update the 3D scene |
492 | 504 | ||
493 | // call the default window message processing function to keep things going |
505 | // call the default window message processing function to keep things going |