case SaveButton:
case Label:
case Break:
+ case -1:
break;
}
if(opts[i].type == EndMark) break;
{ VariantFairy, 0, 135, NULL, (void*) &Pick, "#BFBFBF", NULL, Button, N_("fairy")},
//{ VariantNormal, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_(" ")}, // dummy, to have good alignment
{ VariantCourier, SAME_ROW,135, NULL, (void*) &Pick, "#BFFFBF", NULL, Button, N_("courier (12x8)")},
+// optional buttons for engine-defined variants
+{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL },
+{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL },
+{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL },
+{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL },
+{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL },
+{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL },
+{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL },
+{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL },
+{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL },
+{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL },
+{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL },
+{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL },
{ 0, NO_OK, 0, NULL, NULL, "", NULL, EndMark , "" }
};
Pick (int n)
{
VariantClass v = variantDescriptors[n].value;
+ if(v == VariantUnknown) safeStrCpy(engineVariant, variantDescriptors[n].name, MSG_SIZ); else *engineVariant = NULLCHAR;
if(!appData.noChessProgram) {
char *name = VariantName(v), buf[MSG_SIZ];
if (first.protocolVersion > 1 && StrStr(first.variants, name) == NULL) {
void
NewVariantProc ()
{
+ static int start;
+ int i, last;
if(appData.noChessProgram) sprintf(warning, _("Only bughouse is not available in viewer mode")); else
sprintf(warning, _("All variants not supported by first engine\n(currently %s) are disabled"), first.tidy);
+ if(!start) while(variantDescriptors[start].type != -1) start++; // locate first spare
+ last = -1;
+ for(i=0; variantDescriptors[start+i].type != EndMark; i++) { // create buttons for engine-defined variants
+ char *v = EngineDefinedVariant(&first, i);
+ if(v) {
+ last = i;
+ ASSIGN(variantDescriptors[start+i].name, v);
+ variantDescriptors[start+i].type = Button;
+ } else variantDescriptors[start+i].type = -1;
+ }
+ if(!(last&1)) { // odd number, add filler
+ ASSIGN(variantDescriptors[start+last+1].name, " ");
+ variantDescriptors[start+last+1].type = Button;
+ }
GenericPopUp(variantDescriptors, _("New Variant"), TransientDlg, BoardWindow, MODAL, 0);
}
{ 0, 0, 0, NULL, (void*) &appData.seekGraph, "", NULL, CheckBox, N_("Seek Graph") },
{ 0, 0, 0, NULL, (void*) &appData.autoRefresh, "", NULL, CheckBox, N_("Auto-Refresh Seek Graph") },
{ 0, 0, 0, NULL, (void*) &appData.autoBox, "", NULL, CheckBox, N_("Auto-InputBox PopUp") },
+{ 0, 0, 0, NULL, (void*) &appData.quitNext, "", NULL, CheckBox, N_("Quit after game") },
{ 0, 0, 0, NULL, (void*) &appData.premove, "", NULL, CheckBox, N_("Premove") },
{ 0, 0, 0, NULL, (void*) &appData.premoveWhite, "", NULL, CheckBox, N_("Premove for White") },
{ 0, 0, 0, NULL, (void*) &appData.premoveWhiteText, "", NULL, TextBox, N_("First White Move:") },
static int
NewTagsCallback (int n)
{
- ReplaceTags(tagsText, &gameInfo);
+ if(!bookUp) ReplaceTags(tagsText, &gameInfo);
return 1;
}
changeTags (int n)
{
GenericReadout(tagsOptions, 1);
- if(bookUp) SaveToBook(tagsText); else
+ if(bookUp) SaveToBook(tagsText), DisplayBook(currentMove); else
ReplaceTags(tagsText, &gameInfo);
}
if(SeekGraphClick(Press, x, y, 1)) return NULL;
if(but1 && !PromoScroll(x, y)) DragPieceMove(x, y);
if(but3) MovePV(x, y, lineGap + BOARD_HEIGHT * (squareSize + lineGap));
+ if(appData.highlightDragging) {
+ x = EventToSquare(x, BOARD_WIDTH); if ( flipView && x >= 0) x = BOARD_WIDTH - 1 - x;
+ y = EventToSquare(y, BOARD_HEIGHT); if (!flipView && y >= 0) y = BOARD_HEIGHT - 1 - y;
+ HoverEvent(hi2X, hi2Y, x, y);
+ }
return NULL;
}
if(n != 10 && PopDown(PromoDlg)) fromX = fromY = -1; // user starts fiddling with board when promotion dialog is up