]> granicus.if.org Git - nethack/commitdiff
show autopickup in ^X feedback
authorPatR <rankin@nethack.org>
Thu, 13 Dec 2018 02:55:06 +0000 (18:55 -0800)
committerPatR <rankin@nethack.org>
Thu, 13 Dec 2018 02:55:06 +0000 (18:55 -0800)
Gathers all the autopickup information in one place:

Auto-pickup is { off
               | on { for 'classes' [plus thrown]
                    | all types                   } [, with exceptions] }.

doc/fixes36.2
include/extern.h
src/cmd.c
src/options.c

index 51e6bfa69cefb7c29a79412d6102f88a374b2d44..26305aacff67a5aa039cd832ee59e107f3558e2b 100644 (file)
@@ -406,6 +406,7 @@ for ^X and enlightenment, display the information in a menu rather than a
        '<' (menu_previous_page) and '^' (menu_first_page) menu keys;
        needed for interfaces (tty) without text popup scrollbar support;
        end of game disclosure of attributes remains single-forward-pass
+for ^X, include current state of 'autopickup'
 
 
 NetHack Community Patches (or Variation) Included
index 81b792aa97c642d936e229eef6d6b329dd3a5405..1c88ca32f9c83b808d813b3c2131fedbf0971913 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 extern.h        $NHDT-Date: 1544401264 2018/12/10 00:21:04 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.666 $ */
+/* NetHack 3.6 extern.h        $NHDT-Date: 1544669659 2018/12/13 02:54:19 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.667 $ */
 /* Copyright (c) Steve Creps, 1988.                              */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1729,6 +1729,7 @@ E int FDECL(fruitadd, (char *, struct fruit *));
 E int FDECL(choose_classes_menu, (const char *, int, BOOLEAN_P,
                                   char *, char *));
 E boolean FDECL(parsebindings, (char *));
+E void FDECL(oc_to_str, (char *, char *));
 E void FDECL(add_menu_cmd_alias, (CHAR_P, CHAR_P));
 E char FDECL(get_menu_cmd_key, (CHAR_P));
 E char FDECL(map_menu_cmd, (CHAR_P));
index 67170cec7cb26ff7922ada93ac91205391fb489a..5f484bebf00c39a19db019b3e3ab70d7021b6170 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -1,4 +1,4 @@
-/* NetHack 3.6 cmd.c   $NHDT-Date: 1544050555 2018/12/05 22:55:55 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.314 $ */
+/* NetHack 3.6 cmd.c   $NHDT-Date: 1544669664 2018/12/13 02:54:24 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.315 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2013. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -2019,6 +2019,22 @@ int final;
             enl_msg(Your_wallet, "contains ", "contained ", buf, "");
         }
     }
+
+    if (flags.pickup) {
+        char ocl[MAXOCLASSES + 1];
+
+        Strcpy(buf, "on");
+        oc_to_str(flags.pickup_types, ocl);
+        Sprintf(eos(buf), " for %s%s%s",
+                *ocl ? "'" : "", *ocl ? ocl : "all types", *ocl ? "'" : "");
+        if (flags.pickup_thrown && *ocl) /* *ocl: don't show if 'all types' */
+            Strcat(buf, " plus thrown");
+        if (iflags.autopickup_exceptions[AP_GRAB]
+            || iflags.autopickup_exceptions[AP_LEAVE])
+            Strcat(buf, ", with exceptions");
+    } else
+        Strcpy(buf, "off");
+    enl_msg("Auto-pickup ", "is ", "was ", buf, "");
 }
 
 /* characteristics: expanded version of bottom line strength, dexterity, &c */
index d0358caf0323f4122b4ea66037ace107c1180775..6419c55f0a216df55b4c2913178bd049e8f9a901 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 options.c       $NHDT-Date: 1544669347 2018/12/13 02:49:07 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.343 $ */
+/* NetHack 3.6 options.c       $NHDT-Date: 1544669666 2018/12/13 02:54:26 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.344 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Michael Allison, 2008. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -557,7 +557,6 @@ STATIC_DCL int NDECL(count_menucolors);
 STATIC_DCL boolean FDECL(parse_role_opts, (BOOLEAN_P, const char *,
                                            char *, char **));
 
-STATIC_DCL void FDECL(oc_to_str, (char *, char *));
 STATIC_DCL void FDECL(doset_add_menu, (winid, const char *, int));
 STATIC_DCL void FDECL(opts_add_others, (winid, const char *, int,
                                         char *, int));
@@ -4086,7 +4085,7 @@ static NEARDATA const char *sortltype[] = { "none", "loot", "full" };
  * Convert the given string of object classes to a string of default object
  * symbols.
  */
-STATIC_OVL void
+void
 oc_to_str(src, dest)
 char *src, *dest;
 {