Rev 44 | Rev 52 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 44 | Rev 50 | ||
---|---|---|---|
Line 197... | Line 197... | ||
197 | hDropDownMenu = CreateMenu (); // create the fourth drop-down item |
197 | hDropDownMenu = CreateMenu (); // create the fourth drop-down item |
198 | AppendMenu (hDropDownMenu, MF_STRING, MENUID_HELP_HELP, LOCALIZE (L"Menu_HelpDisplayHelp")); |
198 | AppendMenu (hDropDownMenu, MF_STRING, MENUID_HELP_HELP, LOCALIZE (L"Menu_HelpDisplayHelp")); |
199 | AppendMenu (hDropDownMenu, MF_STRING, MENUID_HELP_GETCHESSGAMES, LOCALIZE (L"Menu_HelpGetChessGames")); |
199 | AppendMenu (hDropDownMenu, MF_STRING, MENUID_HELP_GETCHESSGAMES, LOCALIZE (L"Menu_HelpGetChessGames")); |
200 | AppendMenu (hDropDownMenu, MF_SEPARATOR, 0, NULL); |
200 | AppendMenu (hDropDownMenu, MF_SEPARATOR, 0, NULL); |
201 | AppendMenu (hDropDownMenu, MF_STRING, MENUID_HELP_ADDMODIFYVISUALTHEMES, LOCALIZE (L"Menu_HelpAddModifyThemes")); |
201 | AppendMenu (hDropDownMenu, MF_STRING, MENUID_HELP_ADDMODIFYVISUALTHEMES, LOCALIZE (L"Menu_HelpAddModifyThemes")); |
- | 202 | AppendMenu (hDropDownMenu, MF_STRING, MENUID_HELP_ADDMODIFYENGINES, LOCALIZE (L"Menu_HelpAddModifyEngines")); |
|
202 | AppendMenu (hDropDownMenu, MF_STRING, MENUID_HELP_ADDMODIFYTRANSLATIONS, LOCALIZE (L"Menu_HelpAddModifyTranslations")); |
203 | AppendMenu (hDropDownMenu, MF_STRING, MENUID_HELP_ADDMODIFYTRANSLATIONS, LOCALIZE (L"Menu_HelpAddModifyTranslations")); |
203 | AppendMenu (hDropDownMenu, MF_SEPARATOR, 0, NULL); |
204 | AppendMenu (hDropDownMenu, MF_SEPARATOR, 0, NULL); |
204 | AppendMenu (hDropDownMenu, MF_STRING, MENUID_HELP_ABOUT, LOCALIZE (L"Menu_HelpAbout")); |
205 | AppendMenu (hDropDownMenu, MF_STRING, MENUID_HELP_ABOUT, LOCALIZE (L"Menu_HelpAbout")); |
205 | AppendMenu (hMenu, MF_POPUP, (UINT) hDropDownMenu, LOCALIZE (L"Menu_Help")); |
206 | AppendMenu (hMenu, MF_POPUP, (UINT) hDropDownMenu, LOCALIZE (L"Menu_Help")); |
206 | DestroyMenu (hDropDownMenu); |
207 | DestroyMenu (hDropDownMenu); |
Line 334... | Line 335... | ||
334 | while (*lpCmdLine == '"') |
335 | while (*lpCmdLine == '"') |
335 | lpCmdLine++; // skip leading quotes |
336 | lpCmdLine++; // skip leading quotes |
336 | if ((endptr = strchr (lpCmdLine, '"')) != NULL) |
337 | if ((endptr = strchr (lpCmdLine, '"')) != NULL) |
337 | *endptr = 0; // break the string at the first ending quote |
338 | *endptr = 0; // break the string at the first ending quote |
338 | 339 | ||
- | 340 | // is it a file that exists ? |
|
- | 341 | if (_stat (lpCmdLine, &fileinfo) == 0) |
|
- | 342 | { |
|
- | 343 | ConvertToWideChar (load_pathname, WCHAR_SIZEOF (load_pathname), lpCmdLine); // save pathname string |
|
- | 344 | is_dialogbox_load_validated = true; // and act as if the user just validated a load dialog box |
|
- | 345 | } |
|
339 | #ifndef NDEBUG |
346 | #ifndef NDEBUG |
340 | // is it a registration info ? if so, parse it |
347 | // else is it a registration info ? if so, parse it |
341 | if ((strncmp (lpCmdLine, "/r=", 3) == 0) && ((endptr = strchr (&lpCmdLine[3], ',')) != NULL)) |
348 | else if ((strncmp (lpCmdLine, "/r=", 3) == 0) && ((endptr = strchr (&lpCmdLine[3], ',')) != NULL)) |
342 | { |
349 | { |
343 | *endptr = 0; // break the string at the separator between user email and activation code |
350 | *endptr = 0; // break the string at the separator between user email and activation code |
344 | ConvertToWideChar (temp_string, WCHAR_SIZEOF (temp_string), &lpCmdLine[3]); // read user email |
351 | ConvertToWideChar (temp_string, WCHAR_SIZEOF (temp_string), &lpCmdLine[3]); // read user email |
345 | is_registered = IsRegistrationCorrect (temp_string, atoi (endptr + 1)); // and see whether we're registered or not |
352 | is_registered = IsRegistrationCorrect (temp_string, atoi (endptr + 1)); // and see whether we're registered or not |
346 | DialogBox_NewGame (); // still open the "new game" dialog box |
353 | DialogBox_NewGame (); // still open the "new game" dialog box |
347 | } |
354 | } |
348 | #endif // !NDEBUG |
355 | #endif // !NDEBUG |
349 | - | ||
350 | // is it a file that exists ? |
- | |
351 | if (_stat (lpCmdLine, &fileinfo) == 0) |
- | |
352 | { |
- | |
353 | ConvertToWideChar (load_pathname, WCHAR_SIZEOF (load_pathname), lpCmdLine); // save pathname string |
- | |
354 | is_dialogbox_load_validated = true; // and act as if the user just validated a load dialog box |
- | |
355 | } |
- | |
356 | else |
356 | else |
357 | DialogBox_NewGame (); // if specified filename doesn't exist, fallback to the "new game" dialog box |
357 | DialogBox_NewGame (); // if specified filename doesn't exist, fallback to the "new game" dialog box |
358 | } |
358 | } |
359 | else |
359 | else |
360 | DialogBox_NewGame (); // when no filename is specified, display the new game dialog box |
360 | DialogBox_NewGame (); // when no filename is specified, display the new game dialog box |
Line 586... | Line 586... | ||
586 | if (the_board.viewed_move == the_board.move_count - 1) |
586 | if (the_board.viewed_move == the_board.move_count - 1) |
587 | { |
587 | { |
588 | // get a quick acccess to the last move |
588 | // get a quick acccess to the last move |
589 | last_move = &the_board.moves[the_board.move_count - 1]; |
589 | last_move = &the_board.moves[the_board.move_count - 1]; |
590 | 590 | ||
591 | // if the current player is a human AND its opponent is a |
591 | // if the current player is a human AND its opponent is a computer, allow him to ask us for a hint |
592 | if ((current_player->type == PLAYER_HUMAN) && (opposite_player->type == PLAYER_COMPUTER |
592 | if ((current_player->type == PLAYER_HUMAN) && (opposite_player->type == PLAYER_COMPUTER)) |
593 | EnableMenuItem (GetMenu (hMainWnd), MENUID_CHESSBOARD_SUGGESTMOVE, MF_ENABLED); |
593 | EnableMenuItem (GetMenu (hMainWnd), MENUID_CHESSBOARD_SUGGESTMOVE, MF_ENABLED); |
594 | else |
594 | else |
595 | EnableMenuItem (GetMenu (hMainWnd), MENUID_CHESSBOARD_SUGGESTMOVE, MF_GRAYED); |
595 | EnableMenuItem (GetMenu (hMainWnd), MENUID_CHESSBOARD_SUGGESTMOVE, MF_GRAYED); |
596 | 596 | ||
597 | // (if the current player is a human |
597 | // (if the current player is a human |