break;
}
- if((gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack)
+ if((gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack ||
+ gameMode == IcsObserving && appData.dualBoard) // also allow use of second board for observing two games
&& newGameMode == IcsObserving && gamenum != ics_gamenum && appData.bgObserve) {
// [HGM] bughouse: don't act on alien boards while we play. Just parse the board and save it */
int fac = strchr(elapsed_time, '.') ? 1 : 1000;
+ static int lastBgGame = -1;
char *toSqr;
for (k = 0; k < ranks; k++) {
for (j = 0; j < files; j++)
DisplayWhiteClock(white_time*fac, to_play == 'W');
DisplayBlackClock(black_time*fac, to_play != 'W');
activePartner = to_play;
+ if(gamenum != lastBgGame) {
+ char buf[MSG_SIZ];
+ snprintf(buf, MSG_SIZ, "%s %s %s", white, _("vs."), black);
+ DisplayTitle(buf);
+ }
+ lastBgGame = gamenum;
activePartnerTime = to_play == 'W' ? white_time*fac : black_time*fac;
partnerUp = 0; flipView = !flipView; } // [HGM] dual
snprintf(partnerStatus, MSG_SIZ,"W: %d:%02d B: %d:%02d (%d-%d) %c", white_time*fac/60000, (white_time*fac%60000)/1000,
return;
}
+ if(appData.dualBoard && appData.bgObserve) {
+ if((newGameMode == IcsPlayingWhite || newGameMode == IcsPlayingBlack) && moveNum == 1)
+ SendToICS(ics_prefix), SendToICS("pobserve\n");
+ else if(newGameMode == IcsObserving && (gameMode == BeginningOfGame || gameMode == IcsIdle)) {
+ char buf[MSG_SIZ];
+ snprintf(buf, MSG_SIZ, "%spobserve %s\n", ics_prefix, white);
+ SendToICS(buf);
+ }
+ }
+
/* Modify behavior for initial board display on move listing
of wild games.
*/
if (text == NULL) text = "";
+ if(partnerUp) { SetDialogTitle(DummyDlg, text); return; }
+
if (*text != NULLCHAR) {
safeStrCpy(icon, text, sizeof(icon)/sizeof(icon[0]) );
safeStrCpy(title, text, sizeof(title)/sizeof(title[0]) );
void
SlavePopUp ()
{
+ int size = BOARD_WIDTH*(squareSize + lineGap) + lineGap;
// copy params from main board
dualOptions[0].choice = mainOptions[W_WHITE].choice;
dualOptions[1].choice = mainOptions[W_BLACK].choice;
- dualOptions[3].value = mainOptions[W_BOARD].value;
- dualOptions[3].max = dualOptions[2].max = mainOptions[W_BOARD].max; // board size
- dualOptions[0].max = dualOptions[1].max = mainOptions[W_WHITE].max; // clock width
+ dualOptions[3].value = BOARD_HEIGHT*(squareSize + lineGap) + lineGap;
+ dualOptions[3].max = dualOptions[2].max = size; // board width
+ dualOptions[0].max = dualOptions[1].max = size/2 - 3; // clock width
GenericPopUp(dualOptions, "XBoard", DummyDlg, BoardWindow, NONMODAL, 1);
}
int i;
static Dimension oldWidth, oldHeight;
static VariantClass oldVariant;
- static int oldMono = -1;
+ static int oldMono = -1, oldTwoBoards = 0;
if(!formWidget) return;
+ if(oldTwoBoards && !twoBoards) PopDown(DummyDlg);
+ oldTwoBoards = twoBoards;
+
if(appData.overrideLineGap >= 0) lineGap = appData.overrideLineGap;
boardWidth = lineGap + BOARD_WIDTH * (squareSize + lineGap);
boardHeight = lineGap + BOARD_HEIGHT * (squareSize + lineGap);
-
+fprintf(debugFP, "BOARD %d x %d\n",boardWidth, boardHeight);
if(boardWidth != oldWidth || boardHeight != oldHeight) { // do resizing stuff only if size actually changed
oldWidth = boardWidth; oldHeight = boardHeight;