From 6c79d638fefc182f68c9b539e532256cf218febf Mon Sep 17 00:00:00 2001 From: piaip Date: Sat, 29 Dec 2007 09:27:27 +0000 Subject: - pmore: enable warning messages for movie playing - pfterm: fix chattr optimization for background attr change git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3757 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/pfterm.c | 3 ++- mbbsd/pmore.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'mbbsd') diff --git a/mbbsd/pfterm.c b/mbbsd/pfterm.c index 14c15e67..1dba337a 100644 --- a/mbbsd/pfterm.c +++ b/mbbsd/pfterm.c @@ -1501,10 +1501,11 @@ fterm_chattr(char *s, ftattr oattr, ftattr nattr) // for background change? if ((oblink != blink && !blink) || (obold != bold && !bold) || - (bg == FTATTR_DEFAULT_FG && obg != bg) ) + (bg == FTATTR_DEFAULT_BG && obg != bg) ) { if (lead) lead = 0; else *s++ = ';'; *s++ = '0'; + ofg = FTATTR_DEFAULT_FG; obg = FTATTR_DEFAULT_BG; obold = 0; oblink = 0; diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c index 377657de..3869c472 100644 --- a/mbbsd/pmore.c +++ b/mbbsd/pmore.c @@ -1991,6 +1991,7 @@ pmore(char *fpath, int promptend) buf[0] = 0; if(override_attr) outs(override_attr); snprintf(buf, sizeof(buf), override_msg); + override_attr = NULL; override_msg = NULL; } else @@ -2758,6 +2759,21 @@ mf_moviePromptPlaying(int type) // s may change to anykey... const char *s = PMORE_MSG_MOVIE_PLAYING; + if (override_msg) + { + // we must warn user about something... + move(type ? b_lines-2 : b_lines-1, 0); // clrtoeol? + outs(ANSI_RESET); + if (override_attr) outs(override_attr); + w -= strlen(override_msg); + outs(override_msg); + while(w-- > 0) outc(' '); + + outs(ANSI_RESET ANSI_CLRTOEND); + override_msg = NULL; override_attr = NULL; + w = t_columns -1; + } + move(type ? b_lines-1 : b_lines, 0); // clrtoeol? if (type) -- cgit v1.2.3