diff options
-rw-r--r-- | pttbbs/include/common.h | 1 | ||||
-rw-r--r-- | pttbbs/include/uflags.h | 2 | ||||
-rw-r--r-- | pttbbs/mbbsd/pfterm.c | 64 | ||||
-rw-r--r-- | pttbbs/mbbsd/stuff.c | 19 | ||||
-rw-r--r-- | pttbbs/mbbsd/user.c | 4 |
5 files changed, 49 insertions, 41 deletions
diff --git a/pttbbs/include/common.h b/pttbbs/include/common.h index 6eb0e22f..1f686796 100644 --- a/pttbbs/include/common.h +++ b/pttbbs/include/common.h @@ -222,6 +222,7 @@ #define MAX_RECOMMENDS (100) #define STR_CURSOR "●" +#define STR_CURSOR2 "> " #define STR_UNCUR " " #define NOTREPLYING -1 diff --git a/pttbbs/include/uflags.h b/pttbbs/include/uflags.h index ea747418..cde9cd74 100644 --- a/pttbbs/include/uflags.h +++ b/pttbbs/include/uflags.h @@ -31,7 +31,7 @@ #define UF_LIVERIGHT 0x00200000 // true if get "liveright" already // #define UF_COUNTRY_??? 0x00400000 // reserved // #define UF_COUNTRY_??? 0x00800000 // reserved -// #define UF_??? 0x01000000 // reserved +#define UF_MENU_LIGHTBAR 0x01000000 // true to use lightbar-based menu // #define UF_??? 0x02000000 // reserved // #define UF_??? 0x04000000 // reserved // #define UF_??? 0x08000000 // reserved diff --git a/pttbbs/mbbsd/pfterm.c b/pttbbs/mbbsd/pfterm.c index 584e8874..80c6198a 100644 --- a/pttbbs/mbbsd/pfterm.c +++ b/pttbbs/mbbsd/pfterm.c @@ -2231,48 +2231,42 @@ void grayout(int y, int end, int level) { char grattr = FTATTR_DEFAULT; + int x; y = ranged(y, 0, ft.rows-1); end = ranged(end, 0, ft.rows-1); - if (level == GRAYOUT_COLORBOLD) - { - int x = 0; - for (; y < end; y++) - { - for (x = 0; x < ft.cols-1; x++) - FTAMAP[y][x] |= FTATTR_BOLD; - } - return; - } + // modify attribute based on existing data. + switch (level) { + case GRAYOUT_COLORBOLD: + for (; y < end; y++) { + for (x = 0; x < ft.cols-1; x++) + FTAMAP[y][x] |= FTATTR_BOLD; + } + return; - if (level == GRAYOUT_COLORNORM) - { - int x = 0; - for (; y < end; y++) - { - for (x = 0; x < ft.cols-1; x++) - FTAMAP[y][x] &= ~(FTATTR_BLINK | FTATTR_BOLD); - } - return; + case GRAYOUT_COLORNORM: + for (; y < end; y++) { + for (x = 0; x < ft.cols-1; x++) + FTAMAP[y][x] &= ~(FTATTR_BLINK | FTATTR_BOLD); + } + return; } - if (level == GRAYOUT_BOLD) - { - grattr |= FTATTR_BOLD; - } - else if (level == GRAYOUT_DARK) - { - grattr = FTATTR_MAKE(0,0); - grattr |= FTATTR_BOLD; - } - else if (level == GRAYOUT_NORM) - { - // normal text - } - else - { - // not supported yet + // filling with current attributes. + switch (level) { + case GRAYOUT_BOLD: + grattr |= FTATTR_BOLD; + break; + + case GRAYOUT_DARK: + grattr = FTATTR_MAKE(0,0); + grattr |= FTATTR_BOLD; + break; + + case GRAYOUT_NORM: + // normal text + break; } for (; y <= end; y++) diff --git a/pttbbs/mbbsd/stuff.c b/pttbbs/mbbsd/stuff.c index b148b3e6..209fe386 100644 --- a/pttbbs/mbbsd/stuff.c +++ b/pttbbs/mbbsd/stuff.c @@ -264,9 +264,16 @@ search_num(int ch, int max) void cursor_show(int row, int column) { - move(row, column); - outs(STR_CURSOR); - move(row, column + 1); + if (HasUserFlag(UF_MENU_LIGHTBAR)) { + grayout(row, row + 1, GRAYOUT_COLORBOLD); + move(row, column); + outs(STR_CURSOR2); + move(row, column + 1); + } else { + move(row, column); + outs(STR_CURSOR); + move(row, column + 1); + } } // TODO @@ -276,6 +283,9 @@ cursor_clear(int row, int column) { move(row, column); outs(STR_UNCUR); + if (HasUserFlag(UF_MENU_LIGHTBAR)) { + grayout(row, row + 1, GRAYOUT_COLORNORM); + } } // TODO @@ -287,8 +297,7 @@ cursor_key(int row, int column) cursor_show(row, column); ch = vkey(); - move(row, column); - outs(STR_UNCUR); + cursor_clear(row, column); return ch; } diff --git a/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c index d8bb626b..8ecf094a 100644 --- a/pttbbs/mbbsd/user.c +++ b/pttbbs/mbbsd/user.c @@ -442,6 +442,7 @@ void Customize(void) UF_FAV_NOHILIGHT, UF_NO_MODMARK , UF_COLORED_MODMARK, + UF_MENU_LIGHTBAR, #ifdef DBCSAWARE UF_DBCS_AWARE, UF_DBCS_DROP_REPEAT, @@ -467,6 +468,9 @@ void Customize(void) "DBCS 忽略連線程式為雙位元字集送出的重複按鍵", "DBCS 禁止在雙位元中使用色碼(去除一字雙色)", #endif +#ifdef USE_PFTERM + "MENU (實驗性)啟用光棒選單系統", +#endif #ifdef PLAY_ANGEL "ANGEL (小天使)啟用新的神諭呼叫器設定界面", #endif |