piece == WhiteLance && y == BOARD_HEIGHT-2 );
}
+void
+HoverEvent (int hiX, int hiY, int x, int y)
+{
+ static char baseMarker[BOARD_RANKS][BOARD_FILES], baseLegal[BOARD_RANKS][BOARD_FILES];
+ int r, f;
+ if(!first.highlight) return;
+ if(hiX == -1 && hiY == -1 && x == fromX && y == fromY) // record markings
+ for(r=0; r<BOARD_HEIGHT; r++) for(f=BOARD_LEFT; f<BOARD_RGHT; f++)
+ baseMarker[r][f] = marker[r][f], baseLegal[r][f] = legal[r][f];
+ else if(hiX != x || hiY != y) {
+ // [HGM] lift: entered new to-square; redraw arrow, and inform engine
+ for(r=0; r<BOARD_HEIGHT; r++) for(f=BOARD_LEFT; f<BOARD_RGHT; f++)
+ marker[r][f] = baseMarker[r][f], legal[r][f] = baseLegal[r][f];
+ if(marker[y][x] == 2 && legal[y][x] == 1) {
+ char buf[MSG_SIZ];
+ snprintf(buf, MSG_SIZ, "hover %c%d\n", x + AAA, y + ONE - '0');
+ SendToProgram(buf, &first);
+ }
+ SetHighlights(fromX, fromY, x, y);
+ }
+}
+
void ReportClick(char *action, int x, int y)
{
char buf[MSG_SIZ]; // Inform engine of what user does
void EditBookEvent P((void));
Boolean DisplayBook P((int moveNr));
void SaveToBook P((char *text));
+void HoverEvent P((int hiX, int hiY, int x, int y));
int PackGame P((Board board));
Boolean ParseFEN P((Board board, int *blackPlaysFirst, char *fen));
void ApplyMove P((int fromX, int fromY, int toX, int toY, int promoChar, Board board));
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) 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
dragInfo.pos = pt;\r
}\r
if (appData.highlightDragging) {\r
- SetHighlights(fromX, fromY, x, y);\r
+ HoverEvent(highlightInfo.sq[1].x, highlightInfo.sq[1].y, x, y);\r
if( IsDrawArrowEnabled() && (x < 0 || x >= BOARD_WIDTH || y < 0 || y >= BOARD_HEIGHT) ) {\r
full_repaint = TRUE;\r
}\r
extern int squareSize, lineGap, defaultLineGap;
extern int startedFromPositionFile;
extern char *icsTextMenuString;
-
+extern int hi2X, hi2Y;