Rev 39 | Rev 59 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 39 | Rev 40 | ||
|---|---|---|---|
| Line 129... | Line 129... | ||
| 129 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_ENGINESEARCHDEPTHVALUE), value_string); |
129 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_ENGINESEARCHDEPTHVALUE), value_string); |
| 130 | 130 | ||
| 131 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ALLOWENGINEBLUNDERS), LOCALIZE (L"Options_AllowEngineBlunders")); |
131 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ALLOWENGINEBLUNDERS), LOCALIZE (L"Options_AllowEngineBlunders")); |
| 132 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_1PCCHANCE), LOCALIZE (L"Options_1PercentChance")); |
132 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_1PCCHANCE), LOCALIZE (L"Options_1PercentChance")); |
| 133 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_100PCCHANCE), LOCALIZE (L"Options_100PercentChance")); |
133 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_100PCCHANCE), LOCALIZE (L"Options_100PercentChance")); |
| 134 | if (options.engine.blunder_chances |
134 | if (options.engine.blunder_chances > 0) |
| 135 | swprintf_s (value_string, WCHAR_SIZEOF (value_string), L"%d %%", options.engine.blunder_chances); |
135 | swprintf_s (value_string, WCHAR_SIZEOF (value_string), L"%d %%", options.engine.blunder_chances); |
| 136 | else |
136 | else |
| 137 | value_string[0] = 0; |
137 | value_string[0] = 0; |
| 138 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_ENGINEBLUNDERSVALUE), value_string); |
138 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_ENGINEBLUNDERSVALUE), value_string); |
| 139 | 139 | ||
| Line 295... | Line 295... | ||
| 295 | | ((selectedcolor_history & 0x0000ff00) << 8) |
295 | | ((selectedcolor_history & 0x0000ff00) << 8) |
| 296 | | ((selectedcolor_history & 0x00ff0000) >> 8); // convert from GDI BGR to RGBA |
296 | | ((selectedcolor_history & 0x00ff0000) >> 8); // convert from GDI BGR to RGBA |
| 297 | options.want_sepiafilter = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_USESEPIAFORHISTORY)) != 0); |
297 | options.want_sepiafilter = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_USESEPIAFORHISTORY)) != 0); |
| 298 | options.want_autorotateon1vs1 = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ROTATEBOARD)) != 0); |
298 | options.want_autorotateon1vs1 = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ROTATEBOARD)) != 0); |
| 299 | options.want_sounds = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_PLAYSOUNDS)) != 0); |
299 | options.want_sounds = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_PLAYSOUNDS)) != 0); |
| - | 300 | options.rotate_speed = SendMessage (TabControl_GetItem (tab_control, SLIDER_OPTIONS_ROTATESPEED), TBM_GETPOS, 0, 0); |
|
| - | 301 | ||
| - | 302 | // engine options |
|
| - | 303 | ComboBox_GetLBText (TabControl_GetItem (tab_control, COMBOBOX_ENGINE), ComboBox_GetCurSel (TabControl_GetItem (tab_control, COMBOBOX_ENGINE)), temp_string); |
|
| - | 304 | if (wcscmp (temp_string, options.engine.program) != 0) |
|
| - | 305 | { |
|
| - | 306 | wcscpy_s (options.engine.program, temp_string); |
|
| - | 307 | MessageBox (hWnd, LOCALIZE (L"Options_ChessEngineChangeWillAffectNextGame"), LOCALIZE (L"ImportantMessage"), MB_ICONINFORMATION | MB_OK); |
|
| - | 308 | } |
|
| 300 | 309 | ||
| 301 | options.engine.depth = SendMessage (TabControl_GetItem (tab_control, SLIDER_ENGINE_DIFFICULTYLEVEL), TBM_GETPOS, 0, 0); |
310 | options.engine.depth = SendMessage (TabControl_GetItem (tab_control, SLIDER_ENGINE_DIFFICULTYLEVEL), TBM_GETPOS, 0, 0); |
| - | 311 | if (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ALLOWENGINEBLUNDERS))) |
|
| - | 312 | options.engine.blunder_chances = SendMessage (TabControl_GetItem (tab_control, SLIDER_ENGINE_BLUNDERCHANCE), TBM_GETPOS, 0, 0); |
|
| - | 313 | else |
|
| - | 314 | options.engine.blunder_chances = 0; |
|
| - | 315 | if (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ALLOWENGINERESIGNS))) |
|
| 302 | options. |
316 | options.engine.obstinacy_level = SendMessage (TabControl_GetItem (tab_control, SLIDER_ENGINE_OBSTINACY), TBM_GETPOS, 0, 0); |
| - | 317 | else |
|
| - | 318 | options.engine.obstinacy_level = -1; |
|
| 303 | 319 | ||
| 304 | EndDialog (hWnd, 0); // close the dialog box |
320 | EndDialog (hWnd, 0); // close the dialog box |
| 305 | } |
321 | } |
| 306 | 322 | ||
| 307 | // else was it the cancel button ? |
323 | // else was it the cancel button ? |
| Line 309... | Line 325... | ||
| 309 | EndDialog (hWnd, 0); // close the dialog box |
325 | EndDialog (hWnd, 0); // close the dialog box |
| 310 | 326 | ||
| 311 | // else was it the expert settings button ? |
327 | // else was it the expert settings button ? |
| 312 | else if (wParam_loword == BUTTON_EXPERTSETTINGS) |
328 | else if (wParam_loword == BUTTON_EXPERTSETTINGS) |
| 313 | { |
329 | { |
| - | 330 | ComboBox_GetLBText (TabControl_GetItem (tab_control, COMBOBOX_ENGINE), ComboBox_GetCurSel (TabControl_GetItem (tab_control, COMBOBOX_ENGINE)), temp_string); |
|
| 314 | swprintf_s (temp_string, WCHAR_SIZEOF (temp_string), L"%s\\ |
331 | swprintf_s (temp_string, WCHAR_SIZEOF (temp_string), L"%s\\engines\\%s\\init.txt", temp_string, app_path); |
| 315 | ShellExecute (NULL, L"open", temp_string, NULL, NULL, SW_SHOWNORMAL); // open the engine initialization text file |
332 | ShellExecute (NULL, L"open", temp_string, NULL, NULL, SW_SHOWNORMAL); // open the engine initialization text file |
| 316 | } |
333 | } |
| 317 | 334 | ||
| 318 | // else is it the rotate board check box ? if so, enable or disable the speed slider |
335 | // else is it the rotate board check box ? if so, enable or disable the speed slider |
| 319 | else if (wParam_loword == CHECKBOX_OPTIONS_ROTATEBOARD) |
336 | else if (wParam_loword == CHECKBOX_OPTIONS_ROTATEBOARD) |
| Line 336... | Line 353... | ||
| 336 | is_checked = Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ALLOWENGINEBLUNDERS)); |
353 | is_checked = Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ALLOWENGINEBLUNDERS)); |
| 337 | EnableWindow (TabControl_GetItem (tab_control, SLIDER_ENGINE_BLUNDERCHANCE), is_checked); |
354 | EnableWindow (TabControl_GetItem (tab_control, SLIDER_ENGINE_BLUNDERCHANCE), is_checked); |
| 338 | EnableWindow (TabControl_GetItem (tab_control, STATICTEXT_1PCCHANCE), is_checked); |
355 | EnableWindow (TabControl_GetItem (tab_control, STATICTEXT_1PCCHANCE), is_checked); |
| 339 | EnableWindow (TabControl_GetItem (tab_control, STATICTEXT_100PCCHANCE), is_checked); |
356 | EnableWindow (TabControl_GetItem (tab_control, STATICTEXT_100PCCHANCE), is_checked); |
| 340 | if (is_checked) |
357 | if (is_checked) |
| 341 | { |
- | |
| 342 |
|
358 | swprintf_s (value_string, WCHAR_SIZEOF (value_string), L"%d %%", SendMessage (TabControl_GetItem (tab_control, SLIDER_ENGINE_BLUNDERCHANCE), TBM_GETPOS, 0, 0)); |
| 343 | swprintf_s (value_string, WCHAR_SIZEOF (value_string), L"%d %%", options.engine.blunder_chances); |
- | |
| 344 | } |
- | |
| 345 | else |
359 | else |
| 346 | { |
- | |
| 347 | options.engine.blunder_chances = 0; |
- | |
| 348 | value_string[0] = 0; |
360 | value_string[0] = 0; |
| 349 | } |
- | |
| 350 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_ENGINEBLUNDERSVALUE), value_string); |
361 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_ENGINEBLUNDERSVALUE), value_string); |
| 351 | } |
362 | } |
| 352 | 363 | ||
| 353 | // else is it the allow engine resigns check box ? if so, enable or disable the blunder chance slider |
364 | // else is it the allow engine resigns check box ? if so, enable or disable the blunder chance slider |
| 354 | else if (wParam_loword == CHECKBOX_OPTIONS_ALLOWENGINERESIGNS) |
365 | else if (wParam_loword == CHECKBOX_OPTIONS_ALLOWENGINERESIGNS) |
| Line 356... | Line 367... | ||
| 356 | is_checked = Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ALLOWENGINERESIGNS)); |
367 | is_checked = Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ALLOWENGINERESIGNS)); |
| 357 | EnableWindow (TabControl_GetItem (tab_control, SLIDER_ENGINE_OBSTINACY), is_checked); |
368 | EnableWindow (TabControl_GetItem (tab_control, SLIDER_ENGINE_OBSTINACY), is_checked); |
| 358 | EnableWindow (TabControl_GetItem (tab_control, STATICTEXT_YIELDING), is_checked); |
369 | EnableWindow (TabControl_GetItem (tab_control, STATICTEXT_YIELDING), is_checked); |
| 359 | EnableWindow (TabControl_GetItem (tab_control, STATICTEXT_OBSTINATE), is_checked); |
370 | EnableWindow (TabControl_GetItem (tab_control, STATICTEXT_OBSTINATE), is_checked); |
| 360 | if (is_checked) |
371 | if (is_checked) |
| 361 | { |
- | |
| 362 |
|
372 | swprintf_s (value_string, WCHAR_SIZEOF (value_string), L"%d", 1 + SendMessage (TabControl_GetItem (tab_control, SLIDER_ENGINE_OBSTINACY), TBM_GETPOS, 0, 0)); |
| 363 | swprintf_s (value_string, WCHAR_SIZEOF (value_string), L"%d", 1 + options.engine.obstinacy_level); |
- | |
| 364 | } |
- | |
| 365 | else |
373 | else |
| 366 | { |
- | |
| 367 | options.engine.obstinacy_level = -1; |
- | |
| 368 | value_string[0] = 0; |
374 | value_string[0] = 0; |
| 369 | } |
- | |
| 370 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_ENGINERESIGNVALUE), value_string); |
375 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_ENGINERESIGNVALUE), value_string); |
| 371 | } |
376 | } |
| 372 | 377 | ||
| 373 | // else is it the enable filtering check box ? if so, enable or disable the high quality checkbox |
378 | // else is it the enable filtering check box ? if so, enable or disable the high quality checkbox |
| 374 | else if (wParam_loword == CHECKBOX_OPTIONS_TEXTUREFILTERING) |
379 | else if (wParam_loword == CHECKBOX_OPTIONS_TEXTUREFILTERING) |
| Line 417... | Line 422... | ||
| 417 | // else is it the create/manage account hyperlink ? |
422 | // else is it the create/manage account hyperlink ? |
| 418 | else if (wParam_loword == STATICTEXT_OPTIONS_SERVERURL) |
423 | else if (wParam_loword == STATICTEXT_OPTIONS_SERVERURL) |
| 419 | { |
424 | { |
| 420 | swprintf_s (temp_string, WCHAR_SIZEOF (temp_string), ACCOUNTCREATION_URL, os_language); // build account creation url |
425 | swprintf_s (temp_string, WCHAR_SIZEOF (temp_string), ACCOUNTCREATION_URL, os_language); // build account creation url |
| 421 | ShellExecute (NULL, L"open", temp_string, NULL, NULL, SW_MAXIMIZE); // open the accounts page in the default browser, maximized |
426 | 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)), temp_string); |
- | |
| 428 | if (wcscmp (temp_string, options.engine.program) != 0) |
- | |
| 429 | { |
- | |
| 430 | wcscpy_s (options.engine.program, temp_string); |
- | |
| 431 | MessageBox (hWnd, LOCALIZE (L"Options_RestartNeeded"), LOCALIZE (L"ImportantMessage"), MB_ICONINFORMATION | MB_OK); |
- | |
| 432 | } |
- | |
| 433 | } |
427 | } |
| 434 | } |
428 | } |
| 435 | 429 | ||
| 436 | // else is it a notification for a slider moving ? |
430 | // else is it a notification for a slider moving ? |
| 437 | else if (message == WM_HSCROLL) |
431 | else if (message == WM_HSCROLL) |