X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fjaws.c;h=15be5ee528713fff1d7ff22364598f3cca486d3a;hb=93c28220b231b606325e8353b7c5eaba5ac78eef;hp=27612fb43c6a11f089f965d6091f61847f2c023e;hpb=f35945b9d2f4937cadbe7e91d64f8236f57ad031;p=xboard.git diff --git a/winboard/jaws.c b/winboard/jaws.c index 27612fb..15be5ee 100644 --- a/winboard/jaws.c +++ b/winboard/jaws.c @@ -5,7 +5,7 @@ * Massachusetts. * * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009 Free Software Foundation, Inc. + * 2007, 2008, 2009, 2010 Free Software Foundation, Inc. * * XBoard borrows its colors and the bitmaps.xchess bitmap set from XChess, * which was written and is copyrighted by Wayne Christopher. @@ -282,6 +282,7 @@ InitJAWS() int beeps[] = { 1, 0, 0, 0, 0 }; int beepCodes[] = { 0, MB_OK, MB_ICONERROR, MB_ICONQUESTION, MB_ICONEXCLAMATION, MB_ICONASTERISK }; +static int dropX = -1, dropY = -1; VOID KeyboardEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) @@ -290,6 +291,10 @@ KeyboardEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) char *piece, *xchar, *ynum ; int n, beepType = 1; // empty beep + if(fromX == -1 || fromY == -1) { // if we just dropped piece, stay at that square + fromX = dropX; fromY = dropY; + dropX = dropY = -1; // but only once + } if(fromX == -1 || fromY == -1) { fromX = BOARD_LEFT; fromY = 0; } @@ -345,7 +350,7 @@ KeyboardEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) ynum = SquareToNum(fromY); if(currentPiece != EmptySquare) { // SayString(piece[0] == 'W' ? "white" : "black", TRUE); - sprintf(buf, "%s %s %s", piece, xchar, ynum); + sprintf(buf, "%s %s %s", xchar, ynum, piece); } else sprintf(buf, "%s %s", xchar, ynum); SayString(buf, TRUE); } @@ -889,11 +894,11 @@ SayAllBoard() VOID SayWhosTurn() { - if(gameMode == MachinePlaysBlack || gameMode == IcsPlayingBlack) { + if(gameMode == MachinePlaysBlack || gameMode == IcsPlayingWhite) { if(WhiteOnMove(currentMove)) SayString("It is your turn", FALSE); else SayString("It is your opponents turn", FALSE); - } else if(gameMode == MachinePlaysWhite || gameMode == IcsPlayingWhite) { + } else if(gameMode == MachinePlaysWhite || gameMode == IcsPlayingBlack) { if(WhiteOnMove(currentMove)) SayString("It is your opponents turn", FALSE); else SayString("It is your turn", FALSE); @@ -947,7 +952,7 @@ SayMachineMove(int evenIfDuplicate) break; } } - if(c != lastMover) return; // line is thinking output of future move, ignore. + if(c != lastMover && !evenIfDuplicate) return; // line is thinking output of future move, ignore. if(2*moveNr - (dotCount < 2) == previousMove) return; // do not repeat same move; likely ponder output sprintf(buf, "score %s %d at %d ply", @@ -1071,11 +1076,11 @@ SayClockTime() suppressClocks = 0; // back on after two requests in rapid succession sprintf(buf1, "%s", TimeString(whiteTimeRemaining)); str1 = buf1; - SayString("White's remaining time is", FALSE); + SayString("White clock", FALSE); SayString(str1, FALSE); sprintf(buf2, "%s", TimeString(blackTimeRemaining)); str2 = buf2; - SayString("Black's remaining time is", FALSE); + SayString("Black clock", FALSE); SayString(str2, FALSE); lastWhiteTime = whiteTimeRemaining; lastBlackTime = blackTimeRemaining; @@ -1194,6 +1199,7 @@ NiceTime(int x) if ((char)wParam == 022 && gameMode == EditPosition) { /* . Pop up piece menu */\ POINT pt; int x, y;\ SquareToPos(fromY, fromX, &x, &y);\ + dropX = fromX; dropY = fromY;\ pt.x = x; pt.y = y;\ if(gameInfo.variant != VariantShogi)\ MenuPopup(hwnd, pt, LoadMenu(hInst, "PieceMenu"), -1);\