X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gnushogi%2Fcursesdsp.c;h=d2b336bc9261df89e8837498d5dc59628196c56c;hb=8f60f0c7cf426038ad2fbb5c7061335ed8a5a7cd;hp=2fa6d4cf40b6186adfe774d24ca1a9cd859206fb;hpb=e575a64304bf46ab7bcc29634a982dae82721af5;p=gnushogi.git diff --git a/gnushogi/cursesdsp.c b/gnushogi/cursesdsp.c index 2fa6d4c..d2b336b 100644 --- a/gnushogi/cursesdsp.c +++ b/gnushogi/cursesdsp.c @@ -64,7 +64,7 @@ int mycnt1, mycnt2; -#define MARGIN (4) +#define MARGIN (5) #define TAB (58) #define VIR_C(s) ((flag.reverse) ? (NO_COLS - 1 - column(s)) : column(s)) @@ -446,8 +446,8 @@ Curses_help(void) } -static const short x0[2] = { 54, 2 }; -static const short y0[2] = { 20, 4 }; +static const short x0[2] = { MARGIN + 5*NO_COLS + 4, 2 }; +static const short y0[2] = { 4 + 2 * (NO_ROWS - 1), 4 }; /* @@ -485,6 +485,7 @@ Curses_EditBoard(void) ClearEoln(); FLUSH_SCANW("%s", s); found = 0; + ClearMessage(); if (s[0] == '.') break; @@ -520,15 +521,18 @@ Curses_EditBoard(void) break; } } - + if (!found) + AlwaysShowMessage("Invalid piece type '%c'", s[0]); continue; } c = COL_NUM(s[1]); r = ROW_NUM(s[2]); - if ((c < 0) || (c >= NO_COLS) || (r < 0) || (r >= NO_ROWS)) + if ((c < 0) || (c >= NO_COLS) || (r < 0) || (r >= NO_ROWS)) { + AlwaysShowMessage("Out-of-board '%c%c'", s[1], s[2]); continue; + } sq = locn(r, c); @@ -547,6 +551,9 @@ Curses_EditBoard(void) } } + if (!found) + AlwaysShowMessage("Invalid piece type '%c'", s[0]); + DrawPiece(sq); }