diff options
-rw-r--r-- | pttbbs/mbbsd/acl.c | 2 | ||||
-rw-r--r-- | pttbbs/mbbsd/announce.c | 2 | ||||
-rw-r--r-- | pttbbs/mbbsd/mbbsd.c | 6 | ||||
-rw-r--r-- | pttbbs/mbbsd/menu.c | 2 | ||||
-rw-r--r-- | pttbbs/mbbsd/pfterm.c | 2 | ||||
-rw-r--r-- | pttbbs/mbbsd/stuff.c | 2 | ||||
-rw-r--r-- | pttbbs/mbbsd/talk.c | 49 | ||||
-rw-r--r-- | pttbbs/mbbsd/user.c | 2 |
8 files changed, 37 insertions, 30 deletions
diff --git a/pttbbs/mbbsd/acl.c b/pttbbs/mbbsd/acl.c index 0ca88289..c794bca4 100644 --- a/pttbbs/mbbsd/acl.c +++ b/pttbbs/mbbsd/acl.c @@ -181,7 +181,7 @@ edit_banned_list_for_board(const char *board) { "帳號被砍後水桶會自動解除\n" ANSI_RESET " - 水桶自動解除不會出現在記錄裡,只有手動提前解除的才會\n" ANSI_COLOR(1) " - 想查看某使用者為何被水桶可用(S)或是(L)再用 / 搜尋\n" - ANSI_RESET "" + ANSI_RESET #ifdef WATERBAN_UPGRADE_TIME_STR // enable and change this if you've just made an upgrade ANSI_COLOR(0;32) diff --git a/pttbbs/mbbsd/announce.c b/pttbbs/mbbsd/announce.c index 664c48cb..767cd7e1 100644 --- a/pttbbs/mbbsd/announce.c +++ b/pttbbs/mbbsd/announce.c @@ -217,7 +217,7 @@ a_showmenu(menu_t * pm) time4_t dtime; showtitle("精華文章", pm->mtitle); - prints(" " ANSI_COLOR(1;36) "編號 標 題%56s" ANSI_COLOR(0), + prints(" " ANSI_COLOR(1;36) "編號 標 題%56s" ANSI_RESET, "編 選 日 期"); if (!pm->num) diff --git a/pttbbs/mbbsd/mbbsd.c b/pttbbs/mbbsd/mbbsd.c index ca0d4e4b..f1bcb7af 100644 --- a/pttbbs/mbbsd/mbbsd.c +++ b/pttbbs/mbbsd/mbbsd.c @@ -281,11 +281,11 @@ abort_bbs_debug(int sig) sigprocmask(SIG_UNBLOCK, &sigset, NULL); fprintf(stderr, "%d %d %d %.12s\n", (int)time4(NULL), getpid(), sig, cuser.userid); -#define CRASH_MSG ANSI_COLOR(0) \ +#define CRASH_MSG ANSI_RESET \ "\r\n程式異常, 立刻斷線. \r\n" \ "請洽 " BN_BUGREPORT " 板詳述問題發生經過。\r\n" -#define XCPU_MSG ANSI_COLOR(0) \ +#define XCPU_MSG ANSI_RESET \ "\r\n程式耗用過多計算資源, 立刻斷線。\r\n" \ "可能是 (a)執行太多耗用資源的動作 或 (b)程式掉入無窮迴圈. "\ "請洽 " BN_BUGREPORT " 板詳述問題發生經過。\r\n" @@ -380,7 +380,7 @@ talk_request(int sig GCC_UNUSED) syncnow(); move(0, 0); clrtoeol(); - prints(ANSI_COLOR(33;41) "★%s" ANSI_COLOR(34;47) " [%s] %s " ANSI_COLOR(0) "", + prints(ANSI_COLOR(33;41) "★%s" ANSI_COLOR(34;47) " [%s] %s " ANSI_RESET, SHM->uinfo[currutmp->destuip].userid, Cdatelite(&now), (currutmp->sig == 2) ? "重要消息廣播!(請Ctrl-U,l查看熱訊記錄)" : "呼叫、呼叫,聽到請回答"); diff --git a/pttbbs/mbbsd/menu.c b/pttbbs/mbbsd/menu.c index e1fcc6fc..9b5fbd6e 100644 --- a/pttbbs/mbbsd/menu.c +++ b/pttbbs/mbbsd/menu.c @@ -422,7 +422,7 @@ show_menu(int menu_index, const commands_t * p) move(row, 0); while ((s = p[n].desc)) { if (CheckMenuPerm(p[n].level)) { - prints("%*s (" ANSI_COLOR(1;36) "%c" ANSI_COLOR(0) ")%s\n", + prints("%*s (" ANSI_COLOR(1;36) "%c" ANSI_RESET ")%s\n", menu_column, "", s[1], s+2); } n++; diff --git a/pttbbs/mbbsd/pfterm.c b/pttbbs/mbbsd/pfterm.c index 469a7ca3..849ba49a 100644 --- a/pttbbs/mbbsd/pfterm.c +++ b/pttbbs/mbbsd/pfterm.c @@ -2455,7 +2455,7 @@ int main(int argc, char* argv[]) outs(ANSI_COLOR(1;33) "test " ANSI_COLOR(34) "x" ANSI_RESET "te" ANSI_COLOR(43;0;1;35) " st" - ANSI_COLOR(0) "testx\n"); + ANSI_RESET "testx\n"); refresh(); getchar(); diff --git a/pttbbs/mbbsd/stuff.c b/pttbbs/mbbsd/stuff.c index 2e14b033..a41be477 100644 --- a/pttbbs/mbbsd/stuff.c +++ b/pttbbs/mbbsd/stuff.c @@ -338,7 +338,7 @@ show_help(const char * const helptext[]) clear(); for (i = 0; (str = helptext[i]); i++) { if (*str == '\0') - prints(ANSI_COLOR(1) "【 %s 】" ANSI_COLOR(0) "\n", str + 1); + prints(ANSI_COLOR(1) "【 %s 】" ANSI_RESET "\n", str + 1); else if (*str == '\01') prints("\n" ANSI_COLOR(36) "【 %s 】" ANSI_RESET "\n", str + 1); else diff --git a/pttbbs/mbbsd/talk.c b/pttbbs/mbbsd/talk.c index 6060745c..6293773b 100644 --- a/pttbbs/mbbsd/talk.c +++ b/pttbbs/mbbsd/talk.c @@ -555,45 +555,41 @@ water_scr(const water_t * tw, int which, char type) int i; const int colors[] = {33, 37, 33, 37, 33}; move(8 + which, 28); - outc(' '); - move(8 + which, 28); - prints(ANSI_COLOR(1;37;45) " %c %-14s " ANSI_COLOR(0) "", + SOLVE_ANSI_CACHE(); + prints(ANSI_COLOR(0;1;37;45) " %c %-14s " ANSI_RESET, tw->uin ? ' ' : 'x', tw->userid); for (i = 0; i < 5; ++i) { move(16 + i, 4); - outc(' '); - move(16 + i, 4); + SOLVE_ANSI_CACHE(); if (tw->msg[(tw->top - i + 4) % 5].last_call_in[0] != 0) - prints(ANSI_COLOR(0) " " ANSI_COLOR(1;%d;44) "★%-64s" ANSI_COLOR(0) " \n", + prints(" " ANSI_COLOR(1;%d;44) "★%-64s" ANSI_RESET " \n", colors[i], tw->msg[(tw->top - i + 4) % 5].last_call_in); else - outs(ANSI_COLOR(0) " \n"); + outs(" \n"); } move(21, 4); - outc(' '); - move(21, 4); - prints(ANSI_COLOR(0) " " ANSI_COLOR(1;37;46) "%-66s" ANSI_COLOR(0) " \n", + SOLVE_ANSI_CACHE(); + prints(" " ANSI_COLOR(1;37;46) "%-66s" ANSI_RESET " \n", tw->msg[5].last_call_in); move(0, 0); - outc(' '); - move(0, 0); + SOLVE_ANSI_CACHE(); #ifdef PLAY_ANGEL if (tw->msg[0].msgmode == MSGMODE_TOANGEL) - outs(ANSI_COLOR(0) "回答小主人:"); + outs("回答小主人:"); else #endif - prints(ANSI_COLOR(0) "反擊 %s:", tw->userid); + prints("反擊 %s:", tw->userid); clrtoeol(); move(0, strlen(tw->userid) + 6); } else { move(8 + which, 28); SOLVE_ANSI_CACHE(); - prints(ANSI_COLOR(1;37;44) " %c %-13s " ANSI_COLOR(0) "", + prints(ANSI_COLOR(0;1;37;44) " %c %-13s " ANSI_RESET, tw->uin ? ' ' : 'x', tw->userid); } @@ -619,8 +615,16 @@ my_write2(void) currstat = DBACK; //init screen - move(WB_OFO_USER_TOP, WB_OFO_USER_LEFT); - outs(ANSI_COLOR(1;33;46) " ↑ 水球反擊對象 ↓" ANSI_COLOR(0) ""); + move(WB_OFO_USER_TOP-1, 0); + SOLVE_ANSI_CACHE(); + clrtoln(WB_OFO_MSG_BOTTOM+1); + SOLVE_ANSI_CACHE(); + // extra refresh to solve stupid screen.c escape caching issue +#ifndef USE_PFTERM + refresh(); +#endif + mvouts(WB_OFO_USER_TOP, WB_OFO_USER_LEFT, + ANSI_COLOR(1;33;46) " ↑ 水球反擊對象 ↓" ANSI_RESET); for (i = 0; i < WB_OFO_USER_HEIGHT;++i) if (swater[i] == NULL || swater[i]->pid == 0) break; @@ -632,11 +636,13 @@ my_write2(void) water_scr(swater[i], i, 0); } move(WB_OFO_MSG_TOP, WB_OFO_MSG_LEFT); - outs(ANSI_COLOR(0) " " ANSI_COLOR(1;35) "◇" ANSI_COLOR(1;36) "────────────────" - "─────────────────" ANSI_COLOR(1;35) "◇" ANSI_COLOR(0) " "); + outs(ANSI_RESET " " ANSI_COLOR(1;35) "◇" ANSI_COLOR(1;36) + "─────────────────────────────────" + ANSI_COLOR(1;35) "◇" ANSI_RESET " "); move(WB_OFO_MSG_BOTTOM, WB_OFO_MSG_LEFT); - outs(" " ANSI_COLOR(1;35) "◇" ANSI_COLOR(1;36) "────────────────" - "─────────────────" ANSI_COLOR(1;35) "◇" ANSI_COLOR(0) " "); + outs(" " ANSI_COLOR(1;35) "◇" ANSI_COLOR(1;36) + "─────────────────────────────────" + ANSI_COLOR(1;35) "◇" ANSI_RESET " "); water_scr(swater[0], 0, 1); refresh(); @@ -682,6 +688,7 @@ my_write2(void) } else msg[0] = 0; move(0, 0); + SOLVE_ANSI_CACHE(); outs(ANSI_RESET); clrtoeol(); #ifndef PLAY_ANGEL diff --git a/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c index 6613ad8f..355db0da 100644 --- a/pttbbs/mbbsd/user.c +++ b/pttbbs/mbbsd/user.c @@ -1491,7 +1491,7 @@ u_list_CB(void *data, int num, userec_t * uentp) move(2, 0); clrtoeol(); prints(ANSI_REVERSE " 使用者代號 %-25s 上站 文章 %s " - "最近光臨日期 " ANSI_COLOR(0) "\n", + "最近光臨日期 " ANSI_RESET "\n", "綽號暱稱", HasUserPerm(PERM_SEEULEVELS) ? "等級" : ""); ctx->y = 3; |