X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fjaws.c;h=8aad901a977a76d31d2a67a671b36c041d7c8e40;hb=76d2f540a0bc0a54bbb2aba5e29d5412e7f2191c;hp=95f70d244e646ae66338897184d15a537f2e361c;hpb=399cc00c90b392f98ab83aa08d77077ada6043b5;p=xboard.git diff --git a/winboard/jaws.c b/winboard/jaws.c index 95f70d2..8aad901 100644 --- a/winboard/jaws.c +++ b/winboard/jaws.c @@ -83,16 +83,6 @@ extern long whiteTimeRemaining, blackTimeRemaining, timeControl, timeIncrement; -#if 0 -// from moves.h, but no longer needed, as the new routines are all moved to winboard.c - -extern char* PieceToName P((ChessSquare p, int i)); -extern char* SquareToChar P((int Xpos)); -extern char* SquareToNum P((int Ypos)); -extern int CoordToNum P((char c)); - -#endif - // from moves.c, added WinBoard_F piece types and ranks / files char *squareToChar[] = { "ay", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l" }; @@ -919,13 +909,14 @@ SayWhosTurn() } } +extern char *commentList[]; VOID SayMachineMove(int evenIfDuplicate) { int len, xPos, yPos, moveNr, secondSpace = 0, castle = 0, n; ChessSquare currentpiece; - char *piece, *xchar, *ynum, *p; + char *piece, *xchar, *ynum, *p, checkMark = 0; char c, buf[MSG_SIZ], comment[MSG_SIZ]; static char disambiguation[2]; static int previousMove = 0; @@ -981,6 +972,7 @@ SayMachineMove(int evenIfDuplicate) if(secondSpace) len = secondSpace; // position behind move if(messageText[len-1] == '+' || messageText[len-1] == '#') { /* you are in checkmate */ len--; // strip off check or mate indicator + checkMark = messageText[len]; // make sure still seen after we stip off promo piece } if(messageText[len-2] == '=') { /* promotion */ len-=2; // strip off promotion piece @@ -1037,11 +1029,11 @@ SayMachineMove(int evenIfDuplicate) SayString(piece, FALSE); } else SayString("Capturing onn passann",FALSE); } - if(messageText[len] == '+') SayString("check", FALSE); else - if(messageText[len] == '#') { + } + if(checkMark == '+') SayString("check", FALSE); else + if(checkMark == '#') { SayString("finishing off", FALSE); SayString(WhiteOnMove(n) ? "White" : "Black", FALSE); - } } } @@ -1062,6 +1054,8 @@ SayMachineMove(int evenIfDuplicate) SayString(comment, FALSE); // alphabetic comment (usually game end) } else if(p) SayString(p, FALSE); + if(commentDialog && commentList[currentMove]) SetFocus(commentDialog); + } else { /* starts not with digit */ if(StrCaseStr(messageText, "illegal")) PlayIcsUnfinishedSound();