/*
* Move history for WinBoard
*
- * Author: Alessandro Scotti
+ * Author: Alessandro Scotti (Dec 2005)
*
* ------------------------------------------------------------------------
* This program is free software; you can redistribute it and/or modify
extern WindowPlacement wpMoveHistory;
+extern BoardSize boardSize;
+
/* Module globals */
typedef char MoveHistoryString[ MOVE_LEN*2 ];
static int lastLast = 0;
static int lastCurrent = -1;
+static char lastLastMove[ MOVE_LEN ];
+
static MoveHistoryString * currMovelist;
static ChessProgramStats_Move * currPvInfo;
static int currFirst = 0;
TRUE )
{
result = TRUE;
+
+ /* Special case: last move changed */
+ if( currCurrent == currLast-1 ) {
+ if( strcmp( currMovelist[currCurrent], lastLastMove ) != 0 ) {
+ result = FALSE;
+ }
+ }
}
return result;
/* PV info (if any) */
if( appData.showEvalInMoveHistory && currPvInfo[index].depth > 0 ) {
- sprintf( buf, "%{%s%.2f/%d} ",
+ sprintf( buf, "{%s%.2f/%d} ",
currPvInfo[index].score >= 0 ? "+" : "",
currPvInfo[index].score / 100.0,
currPvInfo[index].depth );
lastFirst = currFirst;
lastLast = currLast;
lastCurrent = currCurrent;
+ lastLastMove[0] = '\0';
+
+ if( lastLast > 0 ) {
+ strcpy( lastLastMove, SavePart( currMovelist[lastLast-1] ) );
+ }
/* Deselect any text, move caret to end of memo */
if( currCurrent >= 0 ) {
SendDlgItemMessage( moveHistoryDialog, IDC_MoveHistory, EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS );
+ /* Set font */
+ SendDlgItemMessage( moveHistoryDialog, IDC_MoveHistory, WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, MAKELPARAM(TRUE, 0 ));
+
/* Restore window placement */
RestoreWindowPlacement( hDlg, &wpMoveHistory );
}