diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-11-12 09:15:09 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-11-12 09:15:09 +0800 |
commit | a658eb04e03ce329437609574037f74f09e98542 (patch) | |
tree | 78a61f524a7de54ce91ffec988a245e85b3260aa | |
parent | fe4092071c9eb4345e62f2c63c02dff2ee7bc33f (diff) | |
download | pttbbs-a658eb04e03ce329437609574037f74f09e98542.tar pttbbs-a658eb04e03ce329437609574037f74f09e98542.tar.gz pttbbs-a658eb04e03ce329437609574037f74f09e98542.tar.bz2 pttbbs-a658eb04e03ce329437609574037f74f09e98542.tar.lz pttbbs-a658eb04e03ce329437609574037f74f09e98542.tar.xz pttbbs-a658eb04e03ce329437609574037f74f09e98542.tar.zst pttbbs-a658eb04e03ce329437609574037f74f09e98542.zip |
wasting lots of time on this.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5252 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/menu.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/pttbbs/mbbsd/menu.c b/pttbbs/mbbsd/menu.c index 2af23573..424cb870 100644 --- a/pttbbs/mbbsd/menu.c +++ b/pttbbs/mbbsd/menu.c @@ -81,6 +81,12 @@ static const int menu_mode_map[M_MENU_MAX] = { PSALE, AMUSE, CHC, NMENU }; +typedef struct { + int (*cmdfunc)(); + int level; + char *desc; /* next/key/description */ +} commands_t; + /////////////////////////////////////////////////////////////////////// void @@ -264,6 +270,21 @@ ZA_Enter(void) static unsigned short menu_row = 12; static unsigned short menu_column = 20; +#ifdef EXP_ALERT_ADBANNER_USONG +static int +decide_menu_row(const commands_t *p) { + if ((p[0].level && !HasUserPerm(p[0].level)) && + HasUserFlag(UF_ADBANNER_USONG) && + HasUserFlag(UF_ADBANNER)) { + return menu_row + 1; + } + + return menu_row; +} +#else +# define decide_menu_row(x) (menu_row) +#endif + static void show_status(void) { @@ -362,12 +383,6 @@ adbanner(int menu_index) #endif } -typedef struct { - int (*cmdfunc)(); - int level; - char *desc; /* next/key/description */ -} commands_t; - static int show_menu(int menu_index, const commands_t * p) { @@ -398,6 +413,7 @@ show_menu(int menu_index, const commands_t * p) move(row++, alert_column); outs(" 上方為使用者心情點歌區,不代表本站立場 "); } + assert(row == decide_menu_row(p)); #endif move(row, 0); @@ -552,13 +568,13 @@ domenu(int menu_index, const char *cmdtitle, int cmd, const commands_t cmdtable[ show_status(); refscreen = NA; } - cursor_clear(menu_row + pos, menu_column); + cursor_clear(decide_menu_row(cmdtable) + pos, menu_column); n = pos = -1; while (++n <= (lastcmdptr = i)) if (CheckMenuPerm(cmdtable[n].level)) pos++; - cursor_show(menu_row + pos, menu_column); + cursor_show(decide_menu_row(cmdtable) + pos, menu_column); } while (((cmd = vkey()) != EOF) || refscreen); abort_bbs(0); |