Let -oneClickMove also work in EditGame mode
[xboard.git] / winboard / winboard.c
index b535d44..ec17e47 100644 (file)
@@ -332,7 +332,7 @@ int dialogItems[][40] = {
 \r
 static char languageBuf[50000], *foreign[1000], *english[1000], *languageFile[MSG_SIZ];\r
 static int lastChecked;\r
-static char oldLanguage[MSG_SIZ], *menuText[10][25];\r
+static char oldLanguage[MSG_SIZ], *menuText[10][30];\r
 extern int tinyLayout;\r
 extern char * menuBarText[][8];\r
 \r
@@ -383,7 +383,7 @@ T_(char *s)
 {   // return the translation of the given string\r
     // efficiency can be improved a lot...\r
     int i=0;\r
-if(appData.debugMode) fprintf(debugFP, "T_(%s)\n", s);\r
+//if(appData.debugMode) fprintf(debugFP, "T_(%s)\n", s);\r
     if(!barbaric) return s;\r
     if(!s) return ""; // sanity\r
     while(english[i]) {\r
@@ -404,7 +404,7 @@ Translate(HWND hDlg, int dialogID)
     if(dialogItems[i][0] != dialogID) return; // unknown dialog, should not happen\r
     GetWindowText( hDlg, buf, MSG_SIZ );\r
     s = T_(buf);\r
-if(appData.debugMode) fprintf(debugFP, "WindowText '%s' -> '%s'\n", buf, s);\r
+//if(appData.debugMode) fprintf(debugFP, "WindowText '%s' -> '%s'\n", buf, s);\r
     if(strcmp(buf, s)) SetWindowText(hDlg, s); // replace by translated string (if different)\r
     for(j=1; k=dialogItems[i][j]; j++) { // translate all listed dialog items\r
         GetDlgItemText(hDlg, k, buf, MSG_SIZ);\r
@@ -2459,7 +2459,7 @@ InitDrawingSizes(BoardSize boardSize, int flags)
   pieceBitmap[2][WhiteBishop] = DoLoadBitmap(hInst, "b", squareSize, "w");\r
   pieceBitmap[2][WhiteRook] = DoLoadBitmap(hInst, "r", squareSize, "w");\r
   pieceBitmap[2][WhiteKing] = DoLoadBitmap(hInst, "k", squareSize, "w");\r
-  if( !strcmp(appData.variant, "shogi") && (squareSize==72 || squareSize==49)) {\r
+  if( gameInfo.variant == VariantShogi && squareSize <= 72 && squareSize >= 33) {\r
     // in Shogi, Hijack the unused Queen for Lance\r
     pieceBitmap[0][WhiteQueen] = DoLoadBitmap(hInst, "l", squareSize, "s");\r
     pieceBitmap[1][WhiteQueen] = DoLoadBitmap(hInst, "l", squareSize, "o");\r
@@ -4073,6 +4073,8 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     x = BOARD_WIDTH - 1 - x;\r
   }\r
 \r
+  shiftKey = GetKeyState(VK_SHIFT) < 0; // [HGM] remember last shift status\r
+\r
   switch (message) {\r
   case WM_LBUTTONDOWN:\r
       if (PtInRect((LPRECT) &whiteRect, pt)) {\r
@@ -6365,7 +6367,8 @@ TypeInMoveDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 \r
   case WM_COMMAND:\r
     switch (LOWORD(wParam)) {\r
-    case IDOK:\r
+    case IDOK:
+      shiftKey = GetKeyState(VK_SHIFT) < 0; // [HGM] remember last shift status\r
       GetDlgItemText(hDlg, OPT_Move, move, sizeof(move));\r
       { int n; Board board;\r
        // [HGM] FENedit\r