Add better watchmenu help

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@480 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Pasi Kallinen 2009-10-18 09:45:42 +00:00
parent 62744f361a
commit 94f0867063
3 changed files with 38 additions and 6 deletions

View File

@ -384,7 +384,7 @@ inprogressmenu (int gameid)
int selected = -1; int selected = -1;
int abs_max_height; int abs_max_height;
int top_banner_hei = 6; int top_banner_hei = 4;
int btm; int btm;
if (sortmode == NUM_SORTMODES) if (sortmode == NUM_SORTMODES)
@ -404,7 +404,7 @@ inprogressmenu (int gameid)
while (1) while (1)
{ {
term_resize_check(); term_resize_check();
max_height = local_LINES - 10; max_height = local_LINES - 8;
if (max_height < 2) { if (max_height < 2) {
free(is_nhext); free(is_nhext);
free_populated_games(games, len); free_populated_games(games, len);
@ -425,12 +425,14 @@ inprogressmenu (int gameid)
erase (); erase ();
drawbanner (&banner, 1, 1); drawbanner (&banner, 1, 1);
/*
mvprintw (3, 1, mvprintw (3, 1,
"During playback, hit 'q' to return here,%s", "During playback, hit 'q' to return here,%s",
(((gameid == -1) || (myconfig[gameid]->spool)) ? " 'm' to send mail (requires login)," : "")); (((gameid == -1) || (myconfig[gameid]->spool)) ? " 'm' to send mail (requires login)," : ""));
mvaddstr (4, 1, mvaddstr (4, 1,
"'s' to toggle graphic-set stripping for DEC, IBM, and none (default)."); "'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)");*/ /*mvaddstr (5, 1, "The following games are in progress: (use uppercase to try to change size)");*/
/* clean old games and list good ones */ /* clean old games and list good ones */
@ -451,7 +453,7 @@ inprogressmenu (int gameid)
snprintf (gametype, sizeof gametype, "%3dx%3d", snprintf (gametype, sizeof gametype, "%3dx%3d",
games[i + offset]->ws_col, games[i + offset]->ws_row); 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, selectorchars[i], games[i + offset]->name, myconfig[games[i + offset]->gamenum]->shortname, gametype,
games[i + offset]->date, games[i + offset]->time, games[i + offset]->date, games[i + offset]->time,
(time (&ctime) - games[i + offset]->idle_time) / 60, (time (&ctime) - games[i + offset]->idle_time) / 60,
@ -469,13 +471,16 @@ inprogressmenu (int gameid)
else else
mvprintw ((btm+top_banner_hei), 1, "(end)"); mvprintw ((btm+top_banner_hei), 1, "(end)");
} }
mvprintw ((btm+1+top_banner_hei), 1, "'.' changes sort mode (current: %s)", SORTMODE_NAME[sortmode]); /*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) => "); mvaddstr ((btm+2+top_banner_hei), 1, "Watch which game? ('?' for help) => ");
refresh (); refresh ();
switch ((menuchoice = getch ())) switch ((menuchoice = getch ()))
{ {
case '?':
(void) runmenuloop(dgl_find_menu("watchmenu_help"));
break;
case '/': case '/':
{ {
int match = -1; int match = -1;

View File

@ -156,6 +156,12 @@ menu["mainmenu_user"] {
commands["q"] = quit 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
}

View File

@ -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.