Rev 192 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 192 | Rev 193 | ||
|---|---|---|---|
| Line 73... | Line 73... | ||
| 73 | wchar_t *port_string; |
73 | wchar_t *port_string; |
| 74 | int language_index; |
74 | int language_index; |
| 75 | int engine_index; |
75 | int engine_index; |
| 76 | int is_checked; |
76 | int is_checked; |
| 77 | int level; |
77 | int level; |
| - | 78 | HWND hCtlWnd; |
|
| 78 | 79 | ||
| 79 | // filter out the commonly used message values |
80 | // filter out the commonly used message values |
| 80 | wParam_hiword = HIWORD (wParam); |
81 | wParam_hiword = HIWORD (wParam); |
| 81 | wParam_loword = LOWORD (wParam); |
82 | wParam_loword = LOWORD (wParam); |
| 82 | 83 | ||
| Line 185... | Line 186... | ||
| 185 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_FULLSCREEN), LOCALIZE (L"Options_Fullscreen")); |
186 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_FULLSCREEN), LOCALIZE (L"Options_Fullscreen")); |
| 186 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_TEXTUREFILTERING), LOCALIZE (L"Options_TextureFiltering")); |
187 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_TEXTUREFILTERING), LOCALIZE (L"Options_TextureFiltering")); |
| 187 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_HIGHQUALITYFILTERING), LOCALIZE (L"Options_HiQualityFiltering")); |
188 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_HIGHQUALITYFILTERING), LOCALIZE (L"Options_HiQualityFiltering")); |
| 188 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SPECULARLIGHTING), LOCALIZE (L"Options_SpecularLighting")); |
189 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SPECULARLIGHTING), LOCALIZE (L"Options_SpecularLighting")); |
| 189 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWREFLECTIONS), LOCALIZE (L"Options_ShowReflections")); |
190 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWREFLECTIONS), LOCALIZE (L"Options_ShowReflections")); |
| - | 191 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_USESEPIAFORHISTORY), LOCALIZE (L"Options_UseSepiaForHistory")); |
|
| - | 192 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_STARTWITHTOPVIEW), LOCALIZE (L"Options_StartWithTopView")); |
|
| - | 193 | ||
| - | 194 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_OPTIONS_PARTLETTERS), LOCALIZE (L"Options_PartLetters")); |
|
| - | 195 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_OPTIONS_PARTNAME_ROOK), LOCALIZE (L"Part_Rook")); |
|
| - | 196 | hCtlWnd = TabControl_GetItem (tab_control, EDITBOX_OPTIONS_PARTLETTER_ROOK); SetWindowText (hCtlWnd, options.part_letters.rook); SendMessage (hCtlWnd, EM_LIMITTEXT, 1, 0); |
|
| - | 197 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_OPTIONS_PARTNAME_KNIGHT), LOCALIZE (L"Part_Knight")); |
|
| - | 198 | hCtlWnd = TabControl_GetItem (tab_control, EDITBOX_OPTIONS_PARTLETTER_KNIGHT); SetWindowText (hCtlWnd, options.part_letters.knight); SendMessage (hCtlWnd, EM_LIMITTEXT, 1, 0); |
|
| - | 199 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_OPTIONS_PARTNAME_BISHOP), LOCALIZE (L"Part_Bishop")); |
|
| - | 200 | hCtlWnd = TabControl_GetItem (tab_control, EDITBOX_OPTIONS_PARTLETTER_BISHOP); SetWindowText (hCtlWnd, options.part_letters.bishop); SendMessage (hCtlWnd, EM_LIMITTEXT, 1, 0); |
|
| - | 201 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_OPTIONS_PARTNAME_QUEEN), LOCALIZE (L"Part_Queen")); |
|
| - | 202 | hCtlWnd = TabControl_GetItem (tab_control, EDITBOX_OPTIONS_PARTLETTER_QUEEN); SetWindowText (hCtlWnd, options.part_letters.queen); SendMessage (hCtlWnd, EM_LIMITTEXT, 1, 0); |
|
| - | 203 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_OPTIONS_PARTNAME_KING), LOCALIZE (L"Part_King")); |
|
| - | 204 | hCtlWnd = TabControl_GetItem (tab_control, EDITBOX_OPTIONS_PARTLETTER_KING); SetWindowText (hCtlWnd, options.part_letters.king); SendMessage (hCtlWnd, EM_LIMITTEXT, 1, 0); |
|
| - | 205 | SetWindowText (TabControl_GetItem (tab_control, BUTTON_STANDARD), LOCALIZE (L"Standard")); |
|
| 190 | 206 | ||
| 191 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_FULLSCREEN), (options.want_fullscreen ? BST_CHECKED : BST_UNCHECKED)); |
207 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_FULLSCREEN), (options.want_fullscreen ? BST_CHECKED : BST_UNCHECKED)); |
| 192 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_TEXTUREFILTERING), (options.want_filtering ? BST_CHECKED : BST_UNCHECKED)); |
208 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_TEXTUREFILTERING), (options.want_filtering ? BST_CHECKED : BST_UNCHECKED)); |
| 193 | EnableWindow (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_HIGHQUALITYFILTERING), options.want_filtering); |
209 | EnableWindow (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_HIGHQUALITYFILTERING), options.want_filtering); |
| 194 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_HIGHQUALITYFILTERING), (options.want_hiquality ? BST_CHECKED : BST_UNCHECKED)); |
210 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_HIGHQUALITYFILTERING), (options.want_hiquality ? BST_CHECKED : BST_UNCHECKED)); |
| 195 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SPECULARLIGHTING), (options.want_specularlighting ? BST_CHECKED : BST_UNCHECKED)); |
211 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SPECULARLIGHTING), (options.want_specularlighting ? BST_CHECKED : BST_UNCHECKED)); |
| 196 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWREFLECTIONS), (options.want_reflections ? BST_CHECKED : BST_UNCHECKED)); |
212 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWREFLECTIONS), (options.want_reflections ? BST_CHECKED : BST_UNCHECKED)); |
| - | 213 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_USESEPIAFORHISTORY), (options.want_sepiafilter ? BST_CHECKED : BST_UNCHECKED)); |
|
| - | 214 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_STARTWITHTOPVIEW), (options.want_startwithtopview ? BST_CHECKED : BST_UNCHECKED)); |
|
| 197 | 215 | ||
| 198 | // setup page 4 (gameplay) |
216 | // setup page 4 (gameplay) |
| 199 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWLASTMOVE), LOCALIZE (L"Options_ShowLastMove")); |
217 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWLASTMOVE), LOCALIZE (L"Options_ShowLastMove")); |
| 200 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWPOSSIBLEMOVES), LOCALIZE (L"Options_ShowPossibleMoves")); |
218 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWPOSSIBLEMOVES), LOCALIZE (L"Options_ShowPossibleMoves")); |
| 201 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWTHREATS), LOCALIZE (L"Options_ShowThreats")); |
219 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWTHREATS), LOCALIZE (L"Options_ShowThreats")); |
| Line 205... | Line 223... | ||
| 205 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWTURN), LOCALIZE (L"Options_ShowTurn")); |
223 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWTURN), LOCALIZE (L"Options_ShowTurn")); |
| 206 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWCLOCK), LOCALIZE (L"Options_ShowClock")); |
224 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWCLOCK), LOCALIZE (L"Options_ShowClock")); |
| 207 | SetWindowText (TabControl_GetItem (tab_control, BUTTON_COLORCLOCK), LOCALIZE (L"Button_Color")); |
225 | SetWindowText (TabControl_GetItem (tab_control, BUTTON_COLORCLOCK), LOCALIZE (L"Button_Color")); |
| 208 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWHISTORY), LOCALIZE (L"Options_ShowHistory")); |
226 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWHISTORY), LOCALIZE (L"Options_ShowHistory")); |
| 209 | SetWindowText (TabControl_GetItem (tab_control, BUTTON_COLORHISTORY), LOCALIZE (L"Button_Color")); |
227 | SetWindowText (TabControl_GetItem (tab_control, BUTTON_COLORHISTORY), LOCALIZE (L"Button_Color")); |
| 210 | SetWindowText (TabControl_GetItem (tab_control, |
228 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_PREFERBLACKSIDE), LOCALIZE (L"Options_PreferBlackSide")); |
| 211 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ROTATEBOARD), LOCALIZE (L"Options_RotateBoard")); |
229 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ROTATEBOARD), LOCALIZE (L"Options_RotateBoard")); |
| 212 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_OPTIONS_ROTATESPEED), LOCALIZE (L"Options_RotateSpeed")); |
230 | SetWindowText (TabControl_GetItem (tab_control, STATICTEXT_OPTIONS_ROTATESPEED), LOCALIZE (L"Options_RotateSpeed")); |
| 213 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_PLAYSOUNDS), LOCALIZE (L"Options_PlaySounds")); |
231 | SetWindowText (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_PLAYSOUNDS), LOCALIZE (L"Options_PlaySounds")); |
| 214 | 232 | ||
| 215 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWLASTMOVE), (options.want_lastmove ? BST_CHECKED : BST_UNCHECKED)); |
233 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWLASTMOVE), (options.want_lastmove ? BST_CHECKED : BST_UNCHECKED)); |
| Line 219... | Line 237... | ||
| 219 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWSLIDINGANIMATIONS), (options.want_slidinganimations ? BST_CHECKED : BST_UNCHECKED)); |
237 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWSLIDINGANIMATIONS), (options.want_slidinganimations ? BST_CHECKED : BST_UNCHECKED)); |
| 220 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWTAKENPARTS), (options.want_takenparts ? BST_CHECKED : BST_UNCHECKED)); |
238 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWTAKENPARTS), (options.want_takenparts ? BST_CHECKED : BST_UNCHECKED)); |
| 221 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWTURN), (options.want_turn ? BST_CHECKED : BST_UNCHECKED)); |
239 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWTURN), (options.want_turn ? BST_CHECKED : BST_UNCHECKED)); |
| 222 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWCLOCK), (options.want_clock ? BST_CHECKED : BST_UNCHECKED)); |
240 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWCLOCK), (options.want_clock ? BST_CHECKED : BST_UNCHECKED)); |
| 223 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWHISTORY), (options.want_history ? BST_CHECKED : BST_UNCHECKED)); |
241 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWHISTORY), (options.want_history ? BST_CHECKED : BST_UNCHECKED)); |
| 224 | Button_SetCheck (TabControl_GetItem (tab_control, |
242 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_PREFERBLACKSIDE), (options.want_playblackside ? BST_CHECKED : BST_UNCHECKED)); |
| 225 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ROTATEBOARD), (options.want_autorotateon1vs1 ? BST_CHECKED : BST_UNCHECKED)); |
243 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ROTATEBOARD), (options.want_autorotateon1vs1 ? BST_CHECKED : BST_UNCHECKED)); |
| 226 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_PLAYSOUNDS), (options.want_sounds ? BST_CHECKED : BST_UNCHECKED)); |
244 | Button_SetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_PLAYSOUNDS), (options.want_sounds ? BST_CHECKED : BST_UNCHECKED)); |
| 227 | SendMessage (TabControl_GetItem (tab_control, SLIDER_OPTIONS_ROTATESPEED), TBM_SETRANGE, true, MAKELONG (5, 80)); |
245 | SendMessage (TabControl_GetItem (tab_control, SLIDER_OPTIONS_ROTATESPEED), TBM_SETRANGE, true, MAKELONG (5, 80)); |
| 228 | SendMessage (TabControl_GetItem (tab_control, SLIDER_OPTIONS_ROTATESPEED), TBM_SETPOS, true, options.rotate_speed); |
246 | SendMessage (TabControl_GetItem (tab_control, SLIDER_OPTIONS_ROTATESPEED), TBM_SETPOS, true, options.rotate_speed); |
| 229 | 247 | ||
| Line 236... | Line 254... | ||
| 236 | selectedcolor_history = ((options.history_color & 0x0000ff00) << 8) |
254 | selectedcolor_history = ((options.history_color & 0x0000ff00) << 8) |
| 237 | | ((options.history_color & 0x00ff0000) >> 8) |
255 | | ((options.history_color & 0x00ff0000) >> 8) |
| 238 | | ((options.history_color & 0xff000000) >> 24); |
256 | | ((options.history_color & 0xff000000) >> 24); |
| 239 | 257 | ||
| 240 | // set focus on the first settable item |
258 | // set focus on the first settable item |
| 241 |
|
259 | hCtlWnd = TabControl_GetItem (tab_control, EDITBOX_LOGIN); |
| 242 |
|
260 | SendMessage (hCtlWnd, EM_SETSEL, 0, -1); // select all text |
| - | 261 | SetFocus (hCtlWnd); |
|
| 243 | } |
262 | } |
| 244 | 263 | ||
| 245 | // else did we click the close button on the title bar ? |
264 | // else did we click the close button on the title bar ? |
| 246 | else if (message == WM_CLOSE) |
265 | else if (message == WM_CLOSE) |
| 247 | EndDialog (hWnd, 0); // close the dialog box |
266 | EndDialog (hWnd, 0); // close the dialog box |
| Line 276... | Line 295... | ||
| 276 | language_index = ComboBox_GetCurSel (TabControl_GetItem (tab_control, COMBOBOX_LANGUAGE)); |
295 | language_index = ComboBox_GetCurSel (TabControl_GetItem (tab_control, COMBOBOX_LANGUAGE)); |
| 277 | is_language_auto = (language_index == 0); // first, see if the system language is selected |
296 | is_language_auto = (language_index == 0); // first, see if the system language is selected |
| 278 | if (!is_language_auto) |
297 | if (!is_language_auto) |
| 279 | language_id = language_index - 1; // because slot #0 of the list is taken by "System Language" |
298 | language_id = language_index - 1; // because slot #0 of the list is taken by "System Language" |
| 280 | CreateOrUpdateApplicationMenu (); // on language change, update the application menu |
299 | CreateOrUpdateApplicationMenu (); // on language change, update the application menu |
| 281 | options.want_fullscreen = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_FULLSCREEN)) != 0); |
300 | options.want_fullscreen = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_FULLSCREEN)) != 0); |
| 282 | options.want_filtering = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_TEXTUREFILTERING)) != 0); |
301 | options.want_filtering = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_TEXTUREFILTERING)) != 0); |
| 283 | options.want_specularlighting = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SPECULARLIGHTING)) != 0); |
302 | options.want_specularlighting = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SPECULARLIGHTING)) != 0); |
| 284 | options.want_reflections = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWREFLECTIONS)) != 0); |
303 | options.want_reflections = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWREFLECTIONS)) != 0); |
| - | 304 | options.want_sepiafilter = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_USESEPIAFORHISTORY)) != 0); |
|
| - | 305 | options.want_startwithtopview = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_STARTWITHTOPVIEW)) != 0); |
|
| - | 306 | ||
| - | 307 | // make sure part letters are unique, only save them if they are |
|
| - | 308 | GetWindowText (TabControl_GetItem (tab_control, EDITBOX_OPTIONS_PARTLETTER_ROOK), &temp_string[0], WCHAR_SIZEOF (temp_string) - 0); |
|
| - | 309 | GetWindowText (TabControl_GetItem (tab_control, EDITBOX_OPTIONS_PARTLETTER_KNIGHT), &temp_string[2], WCHAR_SIZEOF (temp_string) - 2); |
|
| - | 310 | GetWindowText (TabControl_GetItem (tab_control, EDITBOX_OPTIONS_PARTLETTER_BISHOP), &temp_string[4], WCHAR_SIZEOF (temp_string) - 4); |
|
| - | 311 | GetWindowText (TabControl_GetItem (tab_control, EDITBOX_OPTIONS_PARTLETTER_QUEEN), &temp_string[6], WCHAR_SIZEOF (temp_string) - 6); |
|
| - | 312 | GetWindowText (TabControl_GetItem (tab_control, EDITBOX_OPTIONS_PARTLETTER_KING), &temp_string[8], WCHAR_SIZEOF (temp_string) - 8); |
|
| - | 313 | temp_string[1] = temp_string[3] = temp_string[5] = temp_string[7] = temp_string[9] = 0; // terminate the strings ourselves |
|
| - | 314 | if ( (temp_string[2] != temp_string[0]) && (temp_string[4] != temp_string[0]) && (temp_string[4] != temp_string[2]) && (temp_string[6] != temp_string[0]) && (temp_string[6] != temp_string[2]) |
|
| - | 315 | && (temp_string[6] != temp_string[4]) && (temp_string[8] != temp_string[0]) && (temp_string[8] != temp_string[2]) && (temp_string[8] != temp_string[4]) && (temp_string[8] != temp_string[6])) |
|
| - | 316 | { |
|
| - | 317 | wcscpy_s (options.part_letters.rook, WCHAR_SIZEOF (options.part_letters.rook), &temp_string[0]); |
|
| - | 318 | wcscpy_s (options.part_letters.knight, WCHAR_SIZEOF (options.part_letters.knight), &temp_string[2]); |
|
| - | 319 | wcscpy_s (options.part_letters.bishop, WCHAR_SIZEOF (options.part_letters.bishop), &temp_string[4]); |
|
| - | 320 | wcscpy_s (options.part_letters.queen, WCHAR_SIZEOF (options.part_letters.queen), &temp_string[6]); |
|
| - | 321 | wcscpy_s (options.part_letters.king, WCHAR_SIZEOF (options.part_letters.king), &temp_string[8]); |
|
| - | 322 | } |
|
| 285 | 323 | ||
| 286 | // gameplay |
324 | // gameplay |
| 287 | options.network.want_servermessages = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWSERVERMESSAGES)) != 0); |
325 | options.network.want_servermessages = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWSERVERMESSAGES)) != 0); |
| 288 | options.network.want_publicchat = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWPUBLICCHAT)) != 0); |
326 | options.network.want_publicchat = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWPUBLICCHAT)) != 0); |
| 289 | options.want_lastmove = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWLASTMOVE)) != 0); |
327 | options.want_lastmove = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWLASTMOVE)) != 0); |
| Line 299... | Line 337... | ||
| 299 | | ((selectedcolor_clock & 0x00ff0000) >> 8); // convert from GDI BGR to RGBA |
337 | | ((selectedcolor_clock & 0x00ff0000) >> 8); // convert from GDI BGR to RGBA |
| 300 | options.want_history = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWHISTORY)) != 0); |
338 | options.want_history = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_SHOWHISTORY)) != 0); |
| 301 | options.history_color = 0 | ((selectedcolor_history & 0x000000ff) << 24) |
339 | options.history_color = 0 | ((selectedcolor_history & 0x000000ff) << 24) |
| 302 | | ((selectedcolor_history & 0x0000ff00) << 8) |
340 | | ((selectedcolor_history & 0x0000ff00) << 8) |
| 303 | | ((selectedcolor_history & 0x00ff0000) >> 8); // convert from GDI BGR to RGBA |
341 | | ((selectedcolor_history & 0x00ff0000) >> 8); // convert from GDI BGR to RGBA |
| 304 | options. |
342 | options.want_playblackside = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_PREFERBLACKSIDE)) != 0); |
| 305 | options.want_autorotateon1vs1 = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ROTATEBOARD)) != 0); |
343 | options.want_autorotateon1vs1 = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_ROTATEBOARD)) != 0); |
| 306 | options.want_sounds = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_PLAYSOUNDS)) != 0); |
344 | options.want_sounds = (Button_GetCheck (TabControl_GetItem (tab_control, CHECKBOX_OPTIONS_PLAYSOUNDS)) != 0); |
| 307 | options.rotate_speed = SendMessage (TabControl_GetItem (tab_control, SLIDER_OPTIONS_ROTATESPEED), TBM_GETPOS, 0, 0); |
345 | options.rotate_speed = SendMessage (TabControl_GetItem (tab_control, SLIDER_OPTIONS_ROTATESPEED), TBM_GETPOS, 0, 0); |
| 308 | 346 | ||
| 309 | // engine options |
347 | // engine options |
| Line 336... | Line 374... | ||
| 336 | // else was it the expert settings button ? |
374 | // else was it the expert settings button ? |
| 337 | else if (wParam_loword == BUTTON_EXPERTSETTINGS) |
375 | else if (wParam_loword == BUTTON_EXPERTSETTINGS) |
| 338 | { |
376 | { |
| 339 | swprintf_s (temp_string, WCHAR_SIZEOF (temp_string), L"%s\\engines\\%s\\init.txt", app_path, options.engine.programs[ComboBox_GetCurSel (TabControl_GetItem (tab_control, COMBOBOX_ENGINE))].folder); |
377 | swprintf_s (temp_string, WCHAR_SIZEOF (temp_string), L"%s\\engines\\%s\\init.txt", app_path, options.engine.programs[ComboBox_GetCurSel (TabControl_GetItem (tab_control, COMBOBOX_ENGINE))].folder); |
| 340 | ShellExecute (NULL, L"open", temp_string, NULL, NULL, SW_SHOWNORMAL); // open the engine initialization text file |
378 | ShellExecute (NULL, L"open", temp_string, NULL, NULL, SW_SHOWNORMAL); // open the engine initialization text file |
| - | 379 | } |
|
| - | 380 | ||
| - | 381 | // else are we focusing to a part abbreviation edit box ? |
|
| - | 382 | else if ((HIWORD (wParam) == EN_SETFOCUS) && ( (wParam_loword == EDITBOX_OPTIONS_PARTLETTER_ROOK) || (wParam_loword == EDITBOX_OPTIONS_PARTLETTER_KNIGHT) || (wParam_loword == EDITBOX_OPTIONS_PARTLETTER_BISHOP) |
|
| - | 383 | || (wParam_loword == EDITBOX_OPTIONS_PARTLETTER_QUEEN) || (wParam_loword == EDITBOX_OPTIONS_PARTLETTER_KING))) |
|
| - | 384 | PostMessage ((HWND) lParam, EM_SETSEL, 0, -1); // select the whole text |
|
| - | 385 | ||
| - | 386 | // else are we editing a part abbreviation edit box ? |
|
| - | 387 | else if ((HIWORD (wParam) == EN_CHANGE) && ( (wParam_loword == EDITBOX_OPTIONS_PARTLETTER_ROOK) || (wParam_loword == EDITBOX_OPTIONS_PARTLETTER_KNIGHT) || (wParam_loword == EDITBOX_OPTIONS_PARTLETTER_BISHOP) |
|
| - | 388 | || (wParam_loword == EDITBOX_OPTIONS_PARTLETTER_QUEEN) || (wParam_loword == EDITBOX_OPTIONS_PARTLETTER_KING))) |
|
| - | 389 | { |
|
| - | 390 | static bool do_not_hook = false; |
|
| - | 391 | if (!do_not_hook) |
|
| - | 392 | { |
|
| - | 393 | size_t len; |
|
| - | 394 | GetWindowText ((HWND) lParam, temp_string, WCHAR_SIZEOF (temp_string)); |
|
| - | 395 | len = wcslen (temp_string); |
|
| - | 396 | temp_string[0] = (len > 0 ? towupper (temp_string[0]) : 0); |
|
| - | 397 | temp_string[1] = 0; |
|
| - | 398 | do_not_hook = true; // FIXME: dirty |
|
| - | 399 | SetWindowText ((HWND) lParam, temp_string); // update text |
|
| - | 400 | PostMessage ((HWND) lParam, EM_SETSEL, 0, -1); // select the whole text |
|
| - | 401 | do_not_hook = false; // FIXME: dirty |
|
| - | 402 | } |
|
| - | 403 | } |
|
| - | 404 | ||
| - | 405 | // else was it the "standard part abbreviations" button ? |
|
| - | 406 | else if (wParam_loword == BUTTON_STANDARD) |
|
| - | 407 | { |
|
| - | 408 | // reset part abbreviation letters to the international defaults |
|
| - | 409 | wcscpy_s (options.part_letters.rook, WCHAR_SIZEOF (options.part_letters.rook), L"R"); SetWindowText (TabControl_GetItem (tab_control, EDITBOX_OPTIONS_PARTLETTER_ROOK), options.part_letters.rook); |
|
| - | 410 | wcscpy_s (options.part_letters.knight, WCHAR_SIZEOF (options.part_letters.rook), L"N"); SetWindowText (TabControl_GetItem (tab_control, EDITBOX_OPTIONS_PARTLETTER_KNIGHT), options.part_letters.knight); |
|
| - | 411 | wcscpy_s (options.part_letters.bishop, WCHAR_SIZEOF (options.part_letters.rook), L"B"); SetWindowText (TabControl_GetItem (tab_control, EDITBOX_OPTIONS_PARTLETTER_BISHOP), options.part_letters.bishop); |
|
| - | 412 | wcscpy_s (options.part_letters.queen, WCHAR_SIZEOF (options.part_letters.rook), L"Q"); SetWindowText (TabControl_GetItem (tab_control, EDITBOX_OPTIONS_PARTLETTER_QUEEN), options.part_letters.queen); |
|
| - | 413 | wcscpy_s (options.part_letters.king, WCHAR_SIZEOF (options.part_letters.rook), L"K"); SetWindowText (TabControl_GetItem (tab_control, EDITBOX_OPTIONS_PARTLETTER_KING), options.part_letters.king); |
|
| 341 | } |
414 | } |
| 342 | 415 | ||
| 343 | // else is it the rotate board check box ? if so, enable or disable the speed slider |
416 | // else is it the rotate board check box ? if so, enable or disable the speed slider |
| 344 | else if (wParam_loword == CHECKBOX_OPTIONS_ROTATEBOARD) |
417 | else if (wParam_loword == CHECKBOX_OPTIONS_ROTATEBOARD) |
| 345 | { |
418 | { |