From 13730807f72018b51e0e04d6a61aeac579e0d556 Mon Sep 17 00:00:00 2001 From: piaip Date: Wed, 28 Sep 2011 15:25:14 +0000 Subject: angel: don't wait for valid keys in help screen, since many people may fail in copy-pasting URLs and that will trigger help screen and then stuck on any input except 'h'. git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5402 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/mbbsd/angel.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/pttbbs/mbbsd/angel.c b/pttbbs/mbbsd/angel.c index 9e2d0554..d213a9cb 100644 --- a/pttbbs/mbbsd/angel.c +++ b/pttbbs/mbbsd/angel.c @@ -625,30 +625,31 @@ CallAngel(){ void pressanykey_or_callangel(){ int ch; + int w = t_columns - 2; // see vtuikit.c, SAFE_MAX_COL - if (!HasUserPerm(PERM_LOGINOK)) - { + if (!HasUserPerm(PERM_LOGINOK)) { pressanykey(); return; } // TODO use visio API instead. - outmsg( - VCLR_PAUSE_PAD " ▄▄▄▄ " - ANSI_COLOR(32) "H " ANSI_COLOR(36) "呼叫小天使" ANSI_COLOR(34) - " ▄▄▄▄" ANSI_COLOR(37;44) " 請按 " ANSI_COLOR(36) "空白鍵 " - ANSI_COLOR(37) "繼續 " ANSI_COLOR(1;34) - "▄▄▄▄▄▄▄▄▄▄▄▄▄▄ " ANSI_RESET); - do { - ch = vkey(); - if (ch == 'h' || ch == 'H'){ - CallAngel(); - break; - } - } while ((ch != ' ') && (ch != KEY_LEFT) && (ch != '\r') && (ch != '\n')); + move(b_lines, 0); clrtoeol(); + + // message string length = 38 + outs(VCLR_PAUSE_PAD " "); + w -= 1 + 38; + vpad(w / 2, VMSG_PAUSE_PAD); + outs(VCLR_PAUSE " 請按 " ANSI_COLOR(36) "空白鍵" + VCLR_PAUSE " 繼續,或 " ANSI_COLOR(36) "H" + VCLR_PAUSE " 呼叫小天使協助 " VCLR_PAUSE_PAD); + vpad(w - w / 2, VMSG_PAUSE_PAD); + outs(" " ANSI_RESET); + + if (tolower(vkey()) == 'h') + CallAngel(); + move(b_lines, 0); clrtoeol(); - refresh(); } #endif // PLAY_ANGEL -- cgit v1.2.3