{ "icstype", ArgInt, (void *) &ics_type, FALSE, INVALID },
{ "forceIllegalMoves", ArgTrue, (void *) &appData.forceIllegal, FALSE, INVALID },
{ "showTargetSquares", ArgBoolean, (void *) &appData.markers, TRUE, FALSE },
+ { "firstPgnName", ArgString, (void *) &appData.pgnName[0], FALSE, (ArgIniType) "" },
+ { "fn", ArgString, (void *) &appData.pgnName[0], FALSE, INVALID },
+ { "secondPgnName", ArgString, (void *) &appData.pgnName[1], FALSE, (ArgIniType) "" },
+ { "sn", ArgString, (void *) &appData.pgnName[1], FALSE, INVALID },
#if ZIPPY
{ "zippyTalk", ArgBoolean, (void *) &appData.zippyTalk, FALSE, (ArgIniType) ZIPPY_TALK },
}
extern char *engineName, *engineDir, *engineChoice, *engineLine, *nickName, *params;
-extern Boolean isUCI, hasBook, storeVariant, v1, addToList;
+extern Boolean isUCI, hasBook, storeVariant, v1, addToList, useNick;
void
Load(ChessProgramState *cps, int i)
if(engineLine[0]) { // an engine was selected from the combo box
snprintf(buf, MSG_SIZ, "-fcp %s", engineLine);
SwapEngines(i); // kludge to parse -f* / -first* like it is -s* / -second*
- ParseArgsFromString("-firstIsUCI false -firstHasOwnBookUCI true -firstTimeOdds 1");
+ ParseArgsFromString("-firstIsUCI false -firstHasOwnBookUCI true -firstTimeOdds 1 -fn \"\"");
ParseArgsFromString(buf);
SwapEngines(i);
ReplaceEngine(cps, i);
appData.isUCI[i] = isUCI;
appData.protocolVersion[i] = v1 ? 1 : PROTOVER;
appData.hasOwnBookUCI[i] = hasBook;
+ if(!nickName[0]) useNick = FALSE;
+ if(useNick) ASSIGN(appData.pgnName[i], nickName);
if(addToList) {
int len;
q = firstChessProgramNames;
if(nickName[0]) snprintf(buf, MSG_SIZ, "\"%s\" -fcp ", nickName); else buf[0] = NULLCHAR;
- snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), "\"%s\" -fd \"%s\"%s%s%s%s%s\n", p, appData.directory[i],
+ snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), "\"%s\" -fd \"%s\"%s%s%s%s%s%s%s%s\n", p, appData.directory[i],
+ useNick ? " -fn \"" : "",
+ useNick ? nickName : "",
+ useNick ? "\"" : "",
v1 ? " -firstProtocolVersion 1" : "",
hasBook ? "" : " -fNoOwnBookUCI",
isUCI ? " -fUCI" : "",
SWAP(scoreIsAbsolute, h)
SWAP(timeOdds, h)
SWAP(logo, p)
+ SWAP(pgnName, p)
}
void
int i;
char buf[MSG_SIZ], *engineName, *p = appData.participants;
static char resetOptions[] = "-reuse -firstIsUCI false -firstHasOwnBookUCI true -firstTimeOdds 1 -firstOptions \"\" "
- "-firstNeedsNoncompliantFEN false -firstNPS -1";
+ "-firstNeedsNoncompliantFEN false -firstNPS -1 -fn \"\"";
for(i=0; i<player; i++) p = strchr(p, '\n') + 1;
engineName = strdup(p); if(p = strchr(engineName, '\n')) *p = NULLCHAR;
for(i=1; command[i]; i++) if(!strcmp(mnemonic[i], engineName)) break;
gameInfo.round = StrSave("-");
}
if (first.twoMachinesColor[0] == 'w') {
- gameInfo.white = StrSave(first.tidy);
- gameInfo.black = StrSave(second.tidy);
+ gameInfo.white = StrSave(appData.pgnName[0][0] ? appData.pgnName[0] : first.tidy);
+ gameInfo.black = StrSave(appData.pgnName[1][0] ? appData.pgnName[1] : second.tidy);
} else {
- gameInfo.white = StrSave(second.tidy);
- gameInfo.black = StrSave(first.tidy);
+ gameInfo.white = StrSave(appData.pgnName[1][0] ? appData.pgnName[1] : second.tidy);
+ gameInfo.black = StrSave(appData.pgnName[0][0] ? appData.pgnName[0] : first.tidy);
}
gameInfo.timeControl = TimeControlTagValue();
break;
char *computerString[ENGINES];
char *chessProgram[ENGINES];
char *directory[ENGINES];
+ char *pgnName[ENGINES];
Boolean firstPlaysBlack;
Boolean noChessProgram;
char *host[ENGINES];
int checks, combos, buttons, layout, groups;\r
char title[MSG_SIZ];\r
char *engineName, *engineDir, *engineChoice, *engineLine, *nickName, *params;\r
-Boolean isUCI, hasBook, storeVariant, v1, addToList;\r
+Boolean isUCI, hasBook, storeVariant, v1, addToList, useNick;\r
extern Option installOptions[], matchOptions[];\r
char *engineNr[] = { N_("First"), N_("Second"), NULL };\r
char *engineList[1000] = {" "}, *engineMnemonic[1000] = {""};\r
{ 0, 0, 0, NULL, (void*) &engineLine, (char*) engineMnemonic, engineList, ComboBox, N_("Select engine from list:") },\r
{ 0, 0, 0, NULL, NULL, NULL, NULL, Label, N_("or specify one below:") },\r
{ 0, 0, 0, NULL, (void*) &nickName, NULL, NULL, TextBox, N_("Nickname (optional):") },\r
+ { 0, 0, 0, NULL, (void*) &useNick, NULL, NULL, CheckBox, N_("Use nickname in PGN tag") },\r
{ 0, 0, 3, NULL, (void*) &engineName, NULL, NULL, FileName, N_("Engine Executable:") },\r
{ 0, 0, 0, NULL, (void*) ¶ms, NULL, NULL, TextBox, N_("Engine command-line Parameters:") },\r
{ 0, 0, 0, NULL, (void*) &engineDir, NULL, NULL, PathName, N_("Engine Directory:") },\r
{\r
int n=0;\r
\r
- isUCI = addToList = storeVariant = v1 = FALSE; hasBook = TRUE; // defaults\r
+ isUCI = addToList = storeVariant = v1 = useNick = FALSE; hasBook = TRUE; // defaults\r
if(engineDir) free(engineDir); engineDir = strdup("");\r
if(params) free(params); params = strdup("");\r
if(nickName) free(nickName); nickName = strdup("");\r
}
char *engineName, *engineDir, *engineChoice, *engineLine, *nickName, *params;
-Boolean isUCI, hasBook, storeVariant, v1, addToList;
+Boolean isUCI, hasBook, storeVariant, v1, addToList, useNick;
extern Option installOptions[], matchOptions[];
char *engineNr[] = { N_("First Engine"), N_("Second Engine"), NULL };
char *engineList[100] = {" "}, *engineMnemonic[100] = {""};
{ 0, 0, 0, NULL, (void*) &engineLine, (char*) engineMnemonic, engineList, ComboBox, N_("Select engine from list:") },
{ 0, 0, 0, NULL, NULL, NULL, NULL, Label, N_("or specify one below:") },
{ 0, 0, 0, NULL, (void*) &nickName, NULL, NULL, TextBox, N_("Nickname (optional):") },
+{ 0, 0, 0, NULL, (void*) &useNick, NULL, NULL, CheckBox, N_("Use nickname in PGN player tags of engine-engine games") },
{ 0, 0, 0, NULL, (void*) &engineDir, NULL, NULL, PathName, N_("Engine Directory:") },
{ 0, 0, 0, NULL, (void*) &engineName, NULL, NULL, FileName, N_("Engine Command:") },
{ 0, 0, 0, NULL, NULL, NULL, NULL, Label, N_("(Directory will be derived from engine path when empty)") },
String *prms;
Cardinal *nprms;
{
- isUCI = addToList = storeVariant = v1 = False; hasBook = True; // defaults
+ isUCI = addToList = storeVariant = v1 = useNick = False; hasBook = True; // defaults
if(engineChoice) free(engineChoice); engineChoice = strdup(engineNr[0]);
if(engineLine) free(engineLine); engineLine = strdup("");
if(engineDir) free(engineDir); engineDir = strdup("");