Rev 40 | Rev 119 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 40 | Rev 59 | ||
|---|---|---|---|
| Line 67... | Line 67... | ||
| 67 | static WIN32_FIND_DATA wfd; |
67 | static WIN32_FIND_DATA wfd; |
| 68 | 68 | ||
| 69 | unsigned short wParam_hiword; |
69 | unsigned short wParam_hiword; |
| 70 | unsigned short wParam_loword; |
70 | unsigned short wParam_loword; |
| 71 | wchar_t *port_string; |
71 | wchar_t *port_string; |
| - | 72 | int language_index; |
|
| 72 | int wanted_engine; |
73 | int wanted_engine; |
| 73 | int engine_count; |
74 | int engine_count; |
| 74 | HANDLE hFind; |
75 | HANDLE hFind; |
| 75 | int is_checked; |
76 | int is_checked; |
| 76 | 77 | ||
| Line 118... | Line 119... | ||
| 118 | wanted_engine = engine_count; |
119 | wanted_engine = engine_count; |
| 119 | engine_count++; // we've identified one engine more |
120 | 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 | } while (FindNextFile (hFind, &wfd)); // ...and don't stop as long as there are files to go |
| 121 | FindClose (hFind); // close the search handle |
122 | FindClose (hFind); // close the search handle |
| 122 | } |
123 | } |
| 123 | ComboBox_SetCurSel (TabControl_GetItem (tab_control, COMBOBOX_ENGINE), wanted_engine); // select the |
124 | ComboBox_SetCurSel (TabControl_GetItem (tab_control, COMBOBOX_ENGINE), wanted_engine); // select the right entry |
| 124 | 125 | ||
| 125 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_ENGINESEARCHDEPTH), LOCALIZE (L"Options_EnginePredictionLevel")); |
126 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_ENGINESEARCHDEPTH), LOCALIZE (L"Options_EnginePredictionLevel")); |
| 126 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_EASY), LOCALIZE (L"Options_Easy")); |
127 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_EASY), LOCALIZE (L"Options_Easy")); |
| 127 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_HARD), LOCALIZE (L"Options_Hard")); |
128 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_HARD), LOCALIZE (L"Options_Hard")); |
| 128 | swprintf_s (value_string, WCHAR_SIZEOF (value_string), L"%d", options.engine.depth); |
129 | swprintf_s (value_string, WCHAR_SIZEOF (value_string), L"%d", options.engine.depth); |
| Line 184... | Line 185... | ||
| 184 | SetWindowText (TabControl_GetItem (tab_control, EDITBOX_PASSWORD), options.network.password); |
185 | SetWindowText (TabControl_GetItem (tab_control, EDITBOX_PASSWORD), options.network.password); |
| 185 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWPUBLICCHAT), (options.network.want_publicchat ? BST_CHECKED : BST_UNCHECKED)); |
186 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWPUBLICCHAT), (options.network.want_publicchat ? BST_CHECKED : BST_UNCHECKED)); |
| 186 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWSERVERMESSAGES), (options.network.want_servermessages ? BST_CHECKED : BST_UNCHECKED)); |
187 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWSERVERMESSAGES), (options.network.want_servermessages ? BST_CHECKED : BST_UNCHECKED)); |
| 187 | 188 | ||
| 188 | // setup page 3 (display) |
189 | // setup page 3 (display) |
| - | 190 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_LANGUAGE), LOCALIZE (L"Options_Language")); |
|
| - | 191 | for (language_index = 0; language_index < language_count; language_index++) |
|
| - | 192 | ComboBox_AddString (TabControl_GetItem (tab_control, COMBOBOX_LANGUAGE), languages[language_index].name); // add it to the combo box |
|
| - | 193 | ComboBox_SetCurSel (TabControl_GetItem (tab_control, COMBOBOX_LANGUAGE), language_id); // select the right entry |
|
| - | 194 | ||
| 189 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_FULLSCREEN), LOCALIZE (L"Options_Fullscreen")); |
195 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_FULLSCREEN), LOCALIZE (L"Options_Fullscreen")); |
| 190 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_TEXTUREFILTERING), LOCALIZE (L"Options_TextureFiltering")); |
196 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_TEXTUREFILTERING), LOCALIZE (L"Options_TextureFiltering")); |
| 191 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_HIGHQUALITYFILTERING), LOCALIZE (L"Options_HiQualityFiltering")); |
197 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_HIGHQUALITYFILTERING), LOCALIZE (L"Options_HiQualityFiltering")); |
| 192 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SPECULARLIGHTING), LOCALIZE (L"Options_SpecularLighting")); |
198 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SPECULARLIGHTING), LOCALIZE (L"Options_SpecularLighting")); |
| 193 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWREFLECTIONS), LOCALIZE (L"Options_ShowReflections")); |
199 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWREFLECTIONS), LOCALIZE (L"Options_ShowReflections")); |
| Line 272... | Line 278... | ||
| 272 | } |
278 | } |
| 273 | wcscpy_s (options.network.server_address, WCHAR_SIZEOF (options.network.server_address), server_string); // now read the address |
279 | wcscpy_s (options.network.server_address, WCHAR_SIZEOF (options.network.server_address), server_string); // now read the address |
| 274 | GetWindowText (TabControl_GetItem (tab_control, EDITBOX_LOGIN), options.network.login, WCHAR_SIZEOF (options.network.login)); |
280 | GetWindowText (TabControl_GetItem (tab_control, EDITBOX_LOGIN), options.network.login, WCHAR_SIZEOF (options.network.login)); |
| 275 | GetWindowText (TabControl_GetItem (tab_control, EDITBOX_PASSWORD), options.network.password, WCHAR_SIZEOF (options.network.password)); |
281 | GetWindowText (TabControl_GetItem (tab_control, EDITBOX_PASSWORD), options.network.password, WCHAR_SIZEOF (options.network.password)); |
| 276 | 282 | ||
| - | 283 | // display |
|
| 277 |
|
284 | language_id = ComboBox_GetCurSel (TabControl_GetItem (tab_control, COMBOBOX_LANGUAGE)); |
| 278 |
|
285 | CreateOrUpdateApplicationMenu (); // on language change, update the application menu |
| 279 | options.want_fullscreen = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_FULLSCREEN)) != 0); |
286 | options.want_fullscreen = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_FULLSCREEN)) != 0); |
| 280 | options.want_filtering = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_TEXTUREFILTERING)) != 0); |
287 | options.want_filtering = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_TEXTUREFILTERING)) != 0); |
| 281 | options.want_specularlighting = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SPECULARLIGHTING)) != 0); |
288 | options.want_specularlighting = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SPECULARLIGHTING)) != 0); |
| 282 | options.want_reflections = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWREFLECTIONS)) != 0); |
289 | options.want_reflections = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWREFLECTIONS)) != 0); |
| - | 290 | ||
| - | 291 | // gameplay |
|
| - | 292 | options.network.want_servermessages = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWSERVERMESSAGES)) != 0); |
|
| - | 293 | options.network.want_publicchat = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWPUBLICCHAT)) != 0); |
|
| 283 | options.want_lastmove = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWLASTMOVE)) != 0); |
294 | options.want_lastmove = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWLASTMOVE)) != 0); |
| 284 | options.want_possiblemoves = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWPOSSIBLEMOVES)) != 0); |
295 | options.want_possiblemoves = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWPOSSIBLEMOVES)) != 0); |
| 285 | options.want_threats = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWTHREATS)) != 0); |
296 | options.want_threats = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWTHREATS)) != 0); |
| 286 | options.want_animations = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWANIMATIONS)) != 0); |
297 | options.want_animations = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWANIMATIONS)) != 0); |
| 287 | options.want_takenparts = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWTAKENPARTS)) != 0); |
298 | options.want_takenparts = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWTAKENPARTS)) != 0); |
| Line 325... | Line 336... | ||
| 325 | EndDialog (hWnd, 0); // close the dialog box |
336 | EndDialog (hWnd, 0); // close the dialog box |
| 326 | 337 | ||
| 327 | // else was it the expert settings button ? |
338 | // else was it the expert settings button ? |
| 328 | else if (wParam_loword == BUTTON_EXPERTSETTINGS) |
339 | else if (wParam_loword == BUTTON_EXPERTSETTINGS) |
| 329 | { |
340 | { |
| 330 | ComboBox_GetLBText (TabControl_GetItem (tab_control, COMBOBOX_ENGINE), ComboBox_GetCurSel (TabControl_GetItem (tab_control, COMBOBOX_ENGINE)), |
341 | ComboBox_GetLBText (TabControl_GetItem (tab_control, COMBOBOX_ENGINE), ComboBox_GetCurSel (TabControl_GetItem (tab_control, COMBOBOX_ENGINE)), value_string); |
| 331 | swprintf_s (temp_string, WCHAR_SIZEOF (temp_string), L"%s\\engines\\%s\\init.txt", |
342 | swprintf_s (temp_string, WCHAR_SIZEOF (temp_string), L"%s\\engines\\%s\\init.txt", app_path, value_string); |
| 332 | ShellExecute (NULL, L"open", temp_string, NULL, NULL, SW_SHOWNORMAL); // open the engine initialization text file |
343 | ShellExecute (NULL, L"open", temp_string, NULL, NULL, SW_SHOWNORMAL); // open the engine initialization text file |
| 333 | } |
344 | } |
| 334 | 345 | ||
| 335 | // else is it the rotate board check box ? if so, enable or disable the speed slider |
346 | // else is it the rotate board check box ? if so, enable or disable the speed slider |
| 336 | else if (wParam_loword == CHECKBOX_OPTIONS_ROTATEBOARD) |
347 | else if (wParam_loword == CHECKBOX_OPTIONS_ROTATEBOARD) |
| Line 420... | Line 431... | ||
| 420 | } |
431 | } |
| 421 | 432 | ||
| 422 | // else is it the create/manage account hyperlink ? |
433 | // else is it the create/manage account hyperlink ? |
| 423 | else if (wParam_loword == STATICTEXT_OPTIONS_SERVERURL) |
434 | else if (wParam_loword == STATICTEXT_OPTIONS_SERVERURL) |
| 424 | { |
435 | { |
| 425 | swprintf_s (temp_string, WCHAR_SIZEOF (temp_string), ACCOUNTCREATION_URL, |
436 | swprintf_s (temp_string, WCHAR_SIZEOF (temp_string), ACCOUNTCREATION_URL, languages[language_id].name); // build account creation url |
| 426 | ShellExecute (NULL, L"open", temp_string, NULL, NULL, SW_MAXIMIZE); // open the accounts page in the default browser, maximized |
437 | ShellExecute (NULL, L"open", temp_string, NULL, NULL, SW_MAXIMIZE); // open the accounts page in the default browser, maximized |
| 427 | } |
438 | } |
| 428 | } |
439 | } |
| 429 | 440 | ||
| 430 | // else is it a notification for a slider moving ? |
441 | // else is it a notification for a slider moving ? |