]> skyeroc.xyz Git - dgamelaunch/commitdiff
Add better watchmenu help
authorPasi Kallinen <paxed@alt.org>
Sun, 18 Oct 2009 09:45:42 +0000 (09:45 +0000)
committerPasi Kallinen <paxed@alt.org>
Sun, 18 Oct 2009 09:45:42 +0000 (09:45 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@480 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

dgamelaunch.c
examples/dgamelaunch.conf
examples/dgl_menu_watchmenu_help.txt [new file with mode: 0644]

index 25271b15528770705e28f976ecc9785343c425b8..9ecb6d4ae0770991c44e98665f887d660c1a4676 100644 (file)
@@ -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;
index c40a32c1962b007c6eb2e7187d3c25ad2d63ba3c..2cbe2243dd88d62eda2bec24500a2310c7eb1039 100644 (file)
@@ -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 (file)
index 0000000..339c0ee
--- /dev/null
@@ -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