X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwoptions.c;h=6f2adeb9754d14dbec42518a1dc1d0fde48214f0;hb=e6e38912837a4fe2464356408d10dee950b3121c;hp=84733dec2723e7c45830114fbeb79b5b96b88614;hpb=904e6bd26188be8089a74ad9196bc5c2b9479530;p=xboard.git diff --git a/winboard/woptions.c b/winboard/woptions.c index 84733de..6f2adeb 100644 --- a/winboard/woptions.c +++ b/winboard/woptions.c @@ -210,6 +210,8 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) CHECK_BOX(OPT_HighlightMoveArrow, appData.highlightMoveWithArrow); CHECK_BOX(OPT_AutoLogo, appData.autoLogo); // [HGM] logo CHECK_BOX(OPT_SmartMove, appData.oneClick); // [HGM] one-click + CHECK_BOX(OPT_AutoTags, appData.autoDisplayTags); // [HGM] + CHECK_BOX(OPT_AutoComment, appData.autoDisplayComment); // [HGM] #undef CHECK_BOX @@ -259,6 +261,8 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) appData.highlightMoveWithArrow=IS_CHECKED(OPT_HighlightMoveArrow); appData.autoLogo =IS_CHECKED(OPT_AutoLogo); // [HGM] logo appData.oneClick =IS_CHECKED(OPT_SmartMove); // [HGM] one-click + appData.autoDisplayTags =IS_CHECKED(OPT_AutoTags); // [HGM] + appData.autoDisplayComment =IS_CHECKED(OPT_AutoComment); // [HGM] #undef IS_CHECKED @@ -695,6 +699,7 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) } DeleteObject(pieces[0]); DeleteObject(pieces[1]); + DeleteObject(pieces[2]); return TRUE; @@ -838,6 +843,7 @@ int radioButton[] = { -1, -1, OPT_VariantShogi, + -1, // Chu OPT_VariantXiangqi, OPT_VariantCourier, OPT_VariantGothic, @@ -853,9 +859,11 @@ int radioButton[] = { OPT_VariantGreat, -1, // Twilight, OPT_VariantMakruk, + OPT_VariantASEAN, OPT_VariantSChess, OPT_VariantGrand, OPT_VariantSpartan, // Spartan + OPT_VariantLion, -2 // sentinel }; @@ -863,23 +871,40 @@ VariantClass VariantWhichRadio(HWND hDlg) { int i=0, j; + *engineVariant = NULLCHAR; while((j = radioButton[i++]) != -2) { if(j == -1) continue; // no menu button if(IsDlgButtonChecked(hDlg, j) && (appData.noChessProgram || strstr(first.variants, VariantName(i-1)))) return (VariantClass) i-1; } + for(i=0; i<9; i++) { // check for engine-defined variants + if(IsDlgButtonChecked(hDlg, OPT_EngineVariant+i) ) { + GetDlgItemText(hDlg, OPT_EngineVariant+i, engineVariant, MSG_SIZ); // remember name, so we can resolve it later + return VariantUnknown; + } + } return gameInfo.variant; // If no button checked, keep old } void VariantShowRadio(HWND hDlg) { + char c = *engineVariant; int i=0, j; CheckDlgButton(hDlg, radioButton[gameInfo.variant], TRUE); + *engineVariant = NULLCHAR; // [HGM] kludge to prevent VariantName will always return engineVariant while((j = radioButton[i++]) != -2) { if(j == -1) continue; // no menu button EnableWindow(GetDlgItem(hDlg, j), appData.noChessProgram || strstr(first.variants, VariantName(i-1))); } + *engineVariant = c; + for(i=0; i<9; i++) { // initialize engine-defined variants + char *v = EngineDefinedVariant(&first, i); // get name of #i + if(v) { // there is such a variant + EnableWindow(GetDlgItem(hDlg, OPT_EngineVariant+i), TRUE); // and enable the button + SetDlgItemText(hDlg, OPT_EngineVariant+i, v); // put its name on button + } else EnableWindow(GetDlgItem(hDlg, OPT_EngineVariant+i), FALSE); // no such variant; disable button + } } LRESULT CALLBACK @@ -1397,6 +1422,9 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) UpdateSampleText(hDlg, OPT_SampleSeek, &mca[ColorSeek]); break; + + + case OPT_ChooseNormalColor: ColorizeTextPopup(hDlg, ColorNormal); UpdateSampleText(hDlg, OPT_SampleNormal, &mca[ColorNormal]); @@ -1775,6 +1803,7 @@ FontsOptionsPopup(HWND hwnd) SoundComboData soundComboData[] = { {N_("Move"), NULL}, {N_("Bell"), NULL}, + {N_("Roar"), NULL}, {N_("ICS Alarm"), NULL}, {N_("ICS Win"), NULL}, {N_("ICS Loss"), NULL}, @@ -3003,6 +3032,13 @@ BOOL BrowseForFolder( const char * title, char * path ) return result; } +int +IsMultiFormat(char *s) +{ + char *p = strchr(s, ':'); + return p && p != s+1; +} + LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { char buf[MAX_PATH]; @@ -3018,7 +3054,10 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM /* Initialize the dialog items */ SetDlgItemText( hDlg, IDC_PolyglotDir, appData.polyglotDir ); SetDlgItemInt( hDlg, IDC_HashSize, appData.defaultHashSize, TRUE ); + if(appData.defaultPathEGTB[0]) SetDlgItemText( hDlg, IDC_PathToEGTB, appData.defaultPathEGTB ); + else + SetDlgItemText( hDlg, IDC_PathToEGTB, appData.egtFormats ); SetDlgItemInt( hDlg, IDC_SizeOfEGTB, appData.defaultCacheSizeEGTB, TRUE ); CheckDlgButton( hDlg, IDC_UseBook, (BOOL) appData.usePolyglotBook ); SetDlgItemText( hDlg, IDC_BookFile, appData.polyglotBook ); @@ -3043,7 +3082,11 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM appData.defaultHashSize = GetDlgItemInt(hDlg, IDC_HashSize, NULL, FALSE ); appData.defaultCacheSizeEGTB = GetDlgItemInt(hDlg, IDC_SizeOfEGTB, NULL, FALSE ); GetDlgItemText( hDlg, IDC_PathToEGTB, buf, sizeof(buf) ); - appData.defaultPathEGTB = strdup(buf); + if(IsMultiFormat(buf)) { + ASSIGN(appData.egtFormats, buf); + } else { + ASSIGN(appData.defaultPathEGTB, buf); + } GetDlgItemText( hDlg, IDC_BookFile, buf, sizeof(buf) ); appData.polyglotBook = strdup(buf); appData.usePolyglotBook = (Boolean) IsDlgButtonChecked( hDlg, IDC_UseBook );