VariantWhichRadio(HWND hDlg)\r
{\r
int i=0, j;\r
+ *engineVariant = NULLCHAR;\r
while((j = radioButton[i++]) != -2) {\r
if(j == -1) continue; // no menu button\r
if(IsDlgButtonChecked(hDlg, j) &&\r
(appData.noChessProgram || strstr(first.variants, VariantName(i-1)))) return (VariantClass) i-1;\r
}\r
- *engineVariant = NULLCHAR;\r
for(i=0; i<9; i++) { // check for engine-defined variants\r
if(IsDlgButtonChecked(hDlg, OPT_EngineVariant+i) ) {\r
GetDlgItemText(hDlg, OPT_EngineVariant+i, engineVariant, MSG_SIZ); // remember name, so we can resolve it later\r
void\r
VariantShowRadio(HWND hDlg)\r
{\r
+ char c = *engineVariant;\r
int i=0, j;\r
CheckDlgButton(hDlg, radioButton[gameInfo.variant], TRUE);\r
+ *engineVariant = NULLCHAR; // [HGM] kludge to prevent VariantName will always return engineVariant\r
while((j = radioButton[i++]) != -2) {\r
if(j == -1) continue; // no menu button\r
EnableWindow(GetDlgItem(hDlg, j), appData.noChessProgram || strstr(first.variants, VariantName(i-1)));\r
}\r
+ *engineVariant = c;\r
for(i=0; i<9; i++) { // initialize engine-defined variants\r
char *v = EngineDefinedVariant(&first, i); // get name of #i\r
if(v) { // there is such a variant\r