Rev 29 | Rev 39 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 29 | Rev 33 | ||
---|---|---|---|
Line 62... | Line 62... | ||
62 | { |
62 | { |
63 | // message handler for the dialog box |
63 | // message handler for the dialog box |
64 | 64 | ||
65 | static wchar_t temp_string[MAX_PATH]; |
65 | static wchar_t temp_string[MAX_PATH]; |
66 | static wchar_t value_string[32]; |
66 | static wchar_t value_string[32]; |
- | 67 | static WIN32_FIND_DATA wfd; |
|
67 | 68 | ||
68 | unsigned short wParam_hiword; |
69 | unsigned short wParam_hiword; |
69 | unsigned short wParam_loword; |
70 | unsigned short wParam_loword; |
70 | wchar_t *port_string; |
71 | wchar_t *port_string; |
- | 72 | int wanted_engine; |
|
- | 73 | int engine_count; |
|
- | 74 | HANDLE hFind; |
|
71 | int is_checked; |
75 | int is_checked; |
72 | 76 | ||
73 | // filter out the commonly used message values |
77 | // filter out the commonly used message values |
74 | wParam_hiword = HIWORD (wParam); |
78 | wParam_hiword = HIWORD (wParam); |
75 | wParam_loword = LOWORD (wParam); |
79 | wParam_loword = LOWORD (wParam); |
Line 95... | Line 99... | ||
95 | TabControl_AddPage (tab_control, LOCALIZE (L"Options_OnlineGameParameters"), DIALOG_OPTIONS_INTERNET); |
99 | TabControl_AddPage (tab_control, LOCALIZE (L"Options_OnlineGameParameters"), DIALOG_OPTIONS_INTERNET); |
96 | TabControl_AddPage (tab_control, LOCALIZE (L"Options_DisplayParameters"), DIALOG_OPTIONS_DISPLAY); |
100 | TabControl_AddPage (tab_control, LOCALIZE (L"Options_DisplayParameters"), DIALOG_OPTIONS_DISPLAY); |
97 | TabControl_AddPage (tab_control, LOCALIZE (L"Options_GameplayParameters"), DIALOG_OPTIONS_GAMEPLAY); |
101 | TabControl_AddPage (tab_control, LOCALIZE (L"Options_GameplayParameters"), DIALOG_OPTIONS_GAMEPLAY); |
98 | 102 | ||
99 | // setup page 1 (computer play) |
103 | // setup page 1 (computer play) |
- | 104 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_ENGINEPROGRAMNAME), LOCALIZE (L"Options_EngineProgramName")); |
|
- | 105 | engine_count = 0; |
|
- | 106 | wanted_engine = 0; |
|
- | 107 | swprintf_s (temp_string, sizeof (temp_string), L"%s\\engines\\*.*", app_path); // build the search pattern string out of the path |
|
- | 108 | hFind = FindFirstFile (temp_string, &wfd); // initiate search from that point |
|
- | 109 | if (hFind != INVALID_HANDLE_VALUE) |
|
- | 110 | { |
|
- | 111 | // start examining search results... |
|
- | 112 | do |
|
- | 113 | { |
|
- | 114 | if (!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || (wfd.cFileName[0] == L'.')) |
|
- | 115 | continue; // skip everything that is NOT a directory, and every directories that begin with a dot |
|
- | 116 | ComboBox_AddString (TabControl_GetItem (tab_control, COMBOBOX_ENGINE), wfd.cFileName); // add it to the combo box |
|
- | 117 | if (wcscmp (wfd.cFileName, options.engine.program) == 0) |
|
- | 118 | wanted_engine = engine_count; |
|
- | 119 | engine_count++; // we've identified one engine more |
|
- | 120 | } while (FindNextFile (hFind, &wfd)); // ...and don't stop as long as there are files to go |
|
- | 121 | FindClose (hFind); // close the search handle |
|
- | 122 | } |
|
- | 123 | ComboBox_SetCurSel (TabControl_GetItem (tab_control, COMBOBOX_ENGINE), wanted_engine); // select the first entry |
|
- | 124 | ||
100 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_ENGINESEARCHDEPTH), LOCALIZE (L"Options_EnginePredictionLevel")); |
125 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_ENGINESEARCHDEPTH), LOCALIZE (L"Options_EnginePredictionLevel")); |
101 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_EASY), LOCALIZE (L"Options_Easy")); |
126 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_EASY), LOCALIZE (L"Options_Easy")); |
102 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_HARD), LOCALIZE (L"Options_Hard")); |
127 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_HARD), LOCALIZE (L"Options_Hard")); |
103 | swprintf_s (value_string, WCHAR_SIZEOF (value_string), L"%d", options.engine.depth); |
128 | swprintf_s (value_string, WCHAR_SIZEOF (value_string), L"%d", options.engine.depth); |
104 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_ENGINESEARCHDEPTHVALUE), value_string); |
129 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_ENGINESEARCHDEPTHVALUE), value_string); |
Line 392... | Line 417... | ||
392 | // else is it the create/manage account hyperlink ? |
417 | // else is it the create/manage account hyperlink ? |
393 | else if (wParam_loword == STATICTEXT_OPTIONS_SERVERURL) |
418 | else if (wParam_loword == STATICTEXT_OPTIONS_SERVERURL) |
394 | { |
419 | { |
395 | swprintf_s (temp_string, WCHAR_SIZEOF (temp_string), ACCOUNTCREATION_URL, os_language); // build account creation url |
420 | swprintf_s (temp_string, WCHAR_SIZEOF (temp_string), ACCOUNTCREATION_URL, os_language); // build account creation url |
396 | ShellExecute (NULL, L"open", temp_string, NULL, NULL, SW_MAXIMIZE); // open the accounts page in the default browser, maximized |
421 | ShellExecute (NULL, L"open", temp_string, NULL, NULL, SW_MAXIMIZE); // open the accounts page in the default browser, maximized |
- | 422 | } |
|
- | 423 | ||
- | 424 | // else is it a notification for the engine droplist ? |
|
- | 425 | else if (wParam_loword == COMBOBOX_ENGINE) |
|
- | 426 | { |
|
- | 427 | ComboBox_GetLBText (TabControl_GetItem (tab_control, COMBOBOX_ENGINE), ComboBox_GetCurSel (TabControl_GetItem (tab_control, COMBOBOX_ENGINE)), options.engine.program); |
|
397 | } |
428 | } |
398 | } |
429 | } |
399 | 430 | ||
400 | // else is it a notification for a slider moving ? |
431 | // else is it a notification for a slider moving ? |
401 | else if (message == WM_HSCROLL) |
432 | else if (message == WM_HSCROLL) |