X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwoptions.c;h=d3dba208bd6b0fde1b897c6d5a91371c35861753;hb=23f576b5778c131f6c445fecc23e9d9aa693a5e3;hp=8a8406a2f35155a0aa51b9971a11bc48b496d1f2;hpb=167d8bea427f980116580f6a2697c25c55d769c2;p=xboard.git diff --git a/winboard/woptions.c b/winboard/woptions.c index 8a8406a..d3dba20 100644 --- a/winboard/woptions.c +++ b/winboard/woptions.c @@ -843,6 +843,7 @@ int radioButton[] = { -1, -1, OPT_VariantShogi, + -1, // Chu OPT_VariantXiangqi, OPT_VariantCourier, OPT_VariantGothic, @@ -862,6 +863,7 @@ int radioButton[] = { OPT_VariantSChess, OPT_VariantGrand, OPT_VariantSpartan, // Spartan + OPT_VariantLion, -2 // sentinel }; @@ -874,6 +876,13 @@ VariantWhichRadio(HWND hDlg) if(IsDlgButtonChecked(hDlg, j) && (appData.noChessProgram || strstr(first.variants, VariantName(i-1)))) return (VariantClass) i-1; } + *engineVariant = NULLCHAR; + 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 } @@ -886,6 +895,13 @@ VariantShowRadio(HWND hDlg) if(j == -1) continue; // no menu button EnableWindow(GetDlgItem(hDlg, j), appData.noChessProgram || strstr(first.variants, VariantName(i-1))); } + 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 @@ -1403,6 +1419,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]); @@ -1781,6 +1800,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}, @@ -3009,6 +3029,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]; @@ -3024,7 +3051,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 ); @@ -3049,7 +3079,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 );