diff options
author | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-07-16 13:06:02 +0800 |
---|---|---|
committer | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-07-16 13:06:02 +0800 |
commit | 886d32d83cba8c512f3d603fce6e1593c42b680c (patch) | |
tree | e60d1cfc93b4fa1eaad109d889554d3744f421aa | |
parent | 1e09228b6566d733f75b150078149b0046b46e45 (diff) | |
download | pttbbs-886d32d83cba8c512f3d603fce6e1593c42b680c.tar pttbbs-886d32d83cba8c512f3d603fce6e1593c42b680c.tar.gz pttbbs-886d32d83cba8c512f3d603fce6e1593c42b680c.tar.bz2 pttbbs-886d32d83cba8c512f3d603fce6e1593c42b680c.tar.lz pttbbs-886d32d83cba8c512f3d603fce6e1593c42b680c.tar.xz pttbbs-886d32d83cba8c512f3d603fce6e1593c42b680c.tar.zst pttbbs-886d32d83cba8c512f3d603fce6e1593c42b680c.zip |
Show time limit and turning info in chc when displaying photo.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2934 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/chc.h | 2 | ||||
-rw-r--r-- | mbbsd/chc.c | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/include/chc.h b/include/chc.h index 6be0512c..4969b897 100644 --- a/include/chc.h +++ b/include/chc.h @@ -7,7 +7,7 @@ */ #define SIDE_ROW 7 -#define TURN_ROW 8 +#define TURN_ROW (chcd->photo ? 19 : 8) #define STEP_ROW 9 #define TIME_ROW 10 #define WARN_ROW 12 diff --git a/mbbsd/chc.c b/mbbsd/chc.c index c2a4c991..317c2e02 100644 --- a/mbbsd/chc.c +++ b/mbbsd/chc.c @@ -21,7 +21,7 @@ enum Kind { #define CHC_LOG "chc_log" /* log file name */ #define PHOTO_LINE 15 -#define PHOTO_COLUMN 256 +#define PHOTO_COLUMN (256 + 25) typedef int (*play_func_t) (int, const chcusr_t *, const chcusr_t *, board_t, board_t); @@ -278,6 +278,12 @@ chc_drawline(board_t board, const chcusr_t *user1, const chcusr_t *user2, int li outs(" "); if (line >= 3 && line < 3 + PHOTO_LINE) outs(chcd->photo + (line - 3) * PHOTO_COLUMN); + else if (line == 3 + PHOTO_LINE + 1) + prints(" %s%s" ANSI_RESET, + TURN_COLOR, + chcd->my == chcd->turn ? "輪到你下棋了" : "等待對方下棋"); + else if (line == 3 + PHOTO_LINE + 2) + prints(" 剩餘時間 %d:%02d", chcd->lefttime / 60, chcd->lefttime % 60); } else { outs(" "); if (line >= 3 && line < 3 + (int)dim(hint_str)) { @@ -1061,10 +1067,10 @@ chc_init_photo(void) if (fp != NULL) fclose(fp); - sprintf(PHOTO(6), "%s%2.2s棋" ANSI_RESET, + sprintf(PHOTO(6), " %s%2.2s棋" ANSI_RESET, turn_color[chcd->my], turn_str[chcd->my]); strcpy(PHOTO(7), " V.S "); - sprintf(PHOTO(8), "%s%2.2s棋" ANSI_RESET, + sprintf(PHOTO(8), " %s%2.2s棋" ANSI_RESET, turn_color[chcd->my ^ 1], turn_str[chcd->my ^ 1]); getuser(currutmp->mateid, &xuser); |