diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-06-09 17:46:23 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-06-09 17:46:23 +0800 |
commit | 90a92cc9ad9a39a8f4af5394f103c9017ddd1b1d (patch) | |
tree | a965b03d84709681bd591e72b07f4aa6c3285c56 /mbbsd | |
parent | c7b5495e9dc10baf23bb3a781fc30c0a3f017aac (diff) | |
download | pttbbs-90a92cc9ad9a39a8f4af5394f103c9017ddd1b1d.tar pttbbs-90a92cc9ad9a39a8f4af5394f103c9017ddd1b1d.tar.gz pttbbs-90a92cc9ad9a39a8f4af5394f103c9017ddd1b1d.tar.bz2 pttbbs-90a92cc9ad9a39a8f4af5394f103c9017ddd1b1d.tar.lz pttbbs-90a92cc9ad9a39a8f4af5394f103c9017ddd1b1d.tar.xz pttbbs-90a92cc9ad9a39a8f4af5394f103c9017ddd1b1d.tar.zst pttbbs-90a92cc9ad9a39a8f4af5394f103c9017ddd1b1d.zip |
user: don't update passwd so frequently
pmore: trying to make raw-ansi mode better
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2815 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/pmore.c | 22 | ||||
-rw-r--r-- | mbbsd/user.c | 18 |
2 files changed, 29 insertions, 11 deletions
diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c index 26ab541d..45a86866 100644 --- a/mbbsd/pmore.c +++ b/mbbsd/pmore.c @@ -1143,7 +1143,11 @@ mf_display() case MFDISP_RAW_NOANSI: /* TODO * col++ here may be buggy. */ - outc(c); col++; + if(col < t_columns) + { + /* we tried our best to determine */ + outc(c); col++; + } if(!inAnsi) outs(ANSI_RESET); break; @@ -1212,8 +1216,12 @@ mf_display() case MFDISP_RAW_NOANSI: /* TODO * col++ here may be buggy. */ - outs(ANSI_COLOR(1) "*"); - col++; + if(col < t_columns) + { + /* we tried our best to determine */ + outs(ANSI_COLOR(1) "*"); + col++; + } break; case MFDISP_RAW_PLAIN: break; @@ -1445,7 +1453,7 @@ static const char * const pmore_help[] = { "(f/b) 跳至下/上篇", "(a/A) 跳至同一作者下/上篇", "(t/[-/]+) 主題式閱\讀:循序/前/後篇", - "(\\) 切換顯示原始內容", // this IS already aligned! + "(\\/|) 切換顯示原始內容", // this IS already aligned! "(w/W/l) 切換自動折行/折行符號/分隔線顯示方式", "(p/o) 播放動畫/切換傳統模式(狀態列與折行方式)", "(q/←) (h/H/?/F1) 結束/本說明畫面", @@ -2115,7 +2123,11 @@ pmore(char *fpath, int promptend) MFDISP_DIRTY(); break; case '\\': - bpref.rawmode++; + case '|': + if(ch == '|') + bpref.rawmode += MFDISP_RAW_MODES-1; + else + bpref.rawmode ++; bpref.rawmode %= MFDISP_RAW_MODES; switch(bpref.rawmode) { diff --git a/mbbsd/user.c b/mbbsd/user.c index fa97f55f..2fea2b84 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -268,6 +268,7 @@ violate_law(userec_t * u, int unum) void Customize(void) { char done = 0, mindbuf[5]; + int dirty = 0; int key; char *wm[3] = {"一般", "進階", "未來"}; #ifdef PLAY_ANGEL @@ -277,7 +278,7 @@ void Customize(void) showtitle("個人化設定", "個人化設定"); memcpy(mindbuf, &currutmp->mind, 4); mindbuf[4] = 0; - while( !done ){ + while( !done ) { char maxc = 'a'; move(2, 0); outs("您目前的個人化設定: "); @@ -308,7 +309,9 @@ void Customize(void) ((cuser.uflag & DBCSAWARE_FLAG) ? "是" : "否")); maxc = 'i'; #endif - key = getkey("請按 [a-%c] 切換設定,按 [Return] 結束:", maxc); + key = getkey("請按 [a-%c] 切換設定,按 [Return] 結束:", maxc); + + dirty++; switch (tolower(key)) { case 'a':{ @@ -347,16 +350,16 @@ void Customize(void) case 'g': if( HAS_PERM(PERM_ANGEL) ){ SwitchBeingAngel(); - break; } - done = 1; + else + done = 1; break; case 'h': if( HAS_PERM(PERM_ANGEL) ){ SwitchAngelSex(ANGEL_STATUS() + 1); - break; } + break; #endif #ifdef DBCSAWARE @@ -380,10 +383,13 @@ void Customize(void) #endif default: + dirty --; done = 1; + break; } - passwd_update(usernum, &cuser); } + if(dirty) + passwd_update(usernum, &cuser); vmsg("設定完成"); } |