From 94f086706394f34549d53c060e2b4a3c3546b54b Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 18 Oct 2009 09:45:42 +0000 Subject: [PATCH] Add better watchmenu help git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@480 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- dgamelaunch.c | 17 +++++++++++------ examples/dgamelaunch.conf | 6 ++++++ examples/dgl_menu_watchmenu_help.txt | 21 +++++++++++++++++++++ 3 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 examples/dgl_menu_watchmenu_help.txt diff --git a/dgamelaunch.c b/dgamelaunch.c index 25271b1..9ecb6d4 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -384,7 +384,7 @@ inprogressmenu (int gameid) int selected = -1; int abs_max_height; - int top_banner_hei = 6; + int top_banner_hei = 4; int btm; if (sortmode == NUM_SORTMODES) @@ -404,7 +404,7 @@ inprogressmenu (int gameid) while (1) { term_resize_check(); - max_height = local_LINES - 10; + max_height = local_LINES - 8; if (max_height < 2) { free(is_nhext); free_populated_games(games, len); @@ -425,12 +425,14 @@ inprogressmenu (int gameid) erase (); drawbanner (&banner, 1, 1); + /* mvprintw (3, 1, "During playback, hit 'q' to return here,%s", (((gameid == -1) || (myconfig[gameid]->spool)) ? " 'm' to send mail (requires login)," : "")); mvaddstr (4, 1, "'s' to toggle graphic-set stripping for DEC, IBM, and none (default)."); - mvaddstr (5, 1, "The following games are in progress:"); + */ + mvaddstr (3, 1, "The following games are in progress:"); /*mvaddstr (5, 1, "The following games are in progress: (use uppercase to try to change size)");*/ /* clean old games and list good ones */ @@ -451,7 +453,7 @@ inprogressmenu (int gameid) snprintf (gametype, sizeof gametype, "%3dx%3d", games[i + offset]->ws_col, games[i + offset]->ws_row); - mvprintw (7 + i, 1, "%c) %-15s %-5s (%s) %s %s (%ldm %lds idle)", + mvprintw (top_banner_hei + 1 + i, 1, "%c) %-15s %-5s (%s) %s %s (%ldm %lds idle)", selectorchars[i], games[i + offset]->name, myconfig[games[i + offset]->gamenum]->shortname, gametype, games[i + offset]->date, games[i + offset]->time, (time (&ctime) - games[i + offset]->idle_time) / 60, @@ -469,13 +471,16 @@ inprogressmenu (int gameid) else mvprintw ((btm+top_banner_hei), 1, "(end)"); } - mvprintw ((btm+1+top_banner_hei), 1, "'.' changes sort mode (current: %s)", SORTMODE_NAME[sortmode]); - mvaddstr ((btm+2+top_banner_hei), 1, "Watch which game? (letter + enter, 'q' quits, '>'/'<' for more/less) => "); + /*mvprintw ((btm+1+top_banner_hei), 1, "'.' changes sort mode (current: %s)", SORTMODE_NAME[sortmode]);*/ + mvaddstr ((btm+2+top_banner_hei), 1, "Watch which game? ('?' for help) => "); refresh (); switch ((menuchoice = getch ())) { + case '?': + (void) runmenuloop(dgl_find_menu("watchmenu_help")); + break; case '/': { int match = -1; diff --git a/examples/dgamelaunch.conf b/examples/dgamelaunch.conf index c40a32c..2cbe224 100644 --- a/examples/dgamelaunch.conf +++ b/examples/dgamelaunch.conf @@ -156,6 +156,12 @@ menu["mainmenu_user"] { commands["q"] = quit } +# this menu is shown when user presses '?' in the watching menu +menu["watchmenu_help"] { + bannerfile = "dgl_menu_watchmenu_help.txt" + commands["qQ "] = return +} + diff --git a/examples/dgl_menu_watchmenu_help.txt b/examples/dgl_menu_watchmenu_help.txt new file mode 100644 index 0000000..339c0ee --- /dev/null +++ b/examples/dgl_menu_watchmenu_help.txt @@ -0,0 +1,21 @@ +## $SERVERID + + Help for watching-menu + ---------------------- + ? shows this help. + > < next/previous page. + . changes sorting method. + q Q return to main menu. + a-zA-Z selects the game entry. + enter starts showing the selected game. + + + While watching a game + --------------------- + q returns back to the watching menu. + m send mail to the player (requires login). + s toggle charset stripping between DEC/IBM/none. + + + + Press 'q' or space to return to the watching menu. \ No newline at end of file