]> granicus.if.org Git - nethack/commitdiff
lootabc and showrace options
authorkmhugo <kmhugo>
Sun, 31 Mar 2002 06:27:27 +0000 (06:27 +0000)
committerkmhugo <kmhugo>
Sun, 31 Mar 2002 06:27:27 +0000 (06:27 +0000)
Replace "feature_toggle" implementation with an easier-to-understand
boolean option called "lootabc".

Provide "showrace", an option to display the hero by race glyph rather
than by role glyph.

Document the above.

Remove some obsolete Mac options.

dat/opthelp
doc/Guidebook.mn
doc/Guidebook.tex
include/decl.h
include/display.h
include/extern.h
include/flag.h
src/decl.c
src/options.c
src/pickup.c

index c287b110793963ea132ddf2b559e1ec99ac493f2..e152235a455b3025793dde7ad6e06a8f84cc7074 100644 (file)
@@ -17,6 +17,7 @@ IBMgraphics    use IBM extended characters for the dungeon        [FALSE]
 ignintr        ignore interrupt signal, including breaks          [FALSE]
 legacy         print introductory message                         [TRUE]
 lit_corridor   show a dark corridor as lit if in sight            [FALSE]
+lootabc        use a/b/c rather than o/i/b when looting           [FALSE]
 mail           enable the mail daemon                             [TRUE]
 null           allow nulls to be sent to your terminal            [TRUE]
                try turning this option off (forcing NetHack to use its own
@@ -29,6 +30,7 @@ pushweapon     when wielding a new weapon, put your previously
 rawio          allow the use of raw I/O                           [FALSE]
 rest_on_space  count the space bar as a rest character            [FALSE]
 safe_pet       prevent you from (knowingly) attacking your pet(s) [TRUE]
+showrace       show yourself by your race rather than by role     [FALSE]
 silent         don't use your terminal's bell sound               [TRUE]
 sortpack       group similar kinds of objects in inventory        [TRUE]
 sound          enable messages about what your character hears    [TRUE]
index 0b0271d7a0e5c957cb623d011c98ee7633ddf29a..491ed44d5d61be156a5dd935a835cb00bdbd0b40 100644 (file)
@@ -1804,6 +1804,9 @@ Display an introductory message when starting the game (default on).
 .lp lit_corridor
 Show corridor squares seen by night vision or a light source held by your
 character as lit (default off).
+.lp lootabc
+Use the old `a', `b', and `c' keyboard shortcuts when
+looting, rather than the mnemonics `o', `i', and `b' (default off).
 .lp "mail    "
 Enable mail delivery during the game (default on).
 .lp "male    "
@@ -1980,6 +1983,10 @@ Control what parts of the score list you are shown at the end (ex.
 letter of each category (`t', `a', or `o') is necessary.
 .lp showexp
 Show your accumulated experience points on bottom line (default off).
+.lp showrace
+Display yourself as the glyph for your race, rather than the glyph
+for your role (default off).  Note that this setting affects only
+the appearance of the display, not the way the game treats you.
 .lp showscore
 Show your approximate accumulated score on bottom line (default off).
 .lp "silent  "
index b3ced9efe2482b62b2e0a689b4f7365035637660..594f6a7ba8b5c9873ca91ecb7987f9b1a164171b 100644 (file)
@@ -27,7 +27,7 @@
 \begin{document}
 %
 % input file: guidebook.mn
-% $Revision$ $Date$
+% $Revision: 1.37 $ $Date: 2002/03/23 20:03:20 $
 %
 %.ds h0 "
 %.ds h1 %.ds h2 \%
@@ -2235,6 +2235,10 @@ Display an introductory message when starting the game (default on).
 Show corridor squares seen by night vision or a light source held by your
 character as lit (default off).
 %.lp
+\item[\ib{lootabc}]
+Use the old `{\tt a}', `{\tt b}', and `{\tt c}' keyboard shortcuts when
+looting, rather than the mnemonics `{\tt o}', `{\tt i}', and `{\tt b}' (default off).
+%.lp
 \item[\ib{mail}]
 Enable mail delivery during the game (default on).
 %.lp
@@ -2431,6 +2435,11 @@ letter of each category (`{\tt t}', `{\tt a}' or `{\tt o}') is necessary.
 \item[\ib{showexp}]
 Show your accumulated experience points on bottom line (default off).
 %.lp
+\item[\ib{showrace}]
+Display yourself as the glyph for your race, rather than the glyph
+for your role (default off).  Note that this setting affects only
+the appearance of the display, not the way the game treats you.
+%.lp
 \item[\ib{showscore}]
 Show your approximate accumulated score on bottom line (default off).
 %.lp
index dcec14aa989730a47f0b1c3e12005318ca6c939a..717a23fddcc124bf22ba629a32ecd36431298d75 100644 (file)
@@ -370,28 +370,6 @@ E char *fqn_prefix[PREFIX_COUNT];
 E char *fqn_prefix_names[PREFIX_COUNT];
 #endif
 
-/*
- * Feature toggles
- *
- * The following provide a way to offer two different
- * behaviours for a game interface feature, and allow
- * the player to toggle the alternate behaviour on.
- * The feature_name fields stored in the feature_toggles[]
- * array can be specified in an OPTIONS=feature_toggle:value1 value2
- * statement in the config file.
- */
-
-E unsigned long toggled_features;
-
-E struct features_that_toggle {
-       char *feature_name;
-       unsigned long feature_bit;
-} feature_toggles[];
-
-#define TOGGLE_INVALID                 0
-#define TOGGLE_LOOT_MENU_SELECTORS     1       /* index in feature_toogle_list[] */
-#define LAST_FEATURE_TOGGLE            1
-
 #undef E
 
 #endif /* DECL_H */
index fa458ba1b9d2723b7e542e673e544da53d295bca..7b75597267f80f5f4146a1bc86cd2fff8f39563b 100644 (file)
 #define ridden_monnum_to_glyph(mnum)   ((int) (mnum) + GLYPH_RIDDEN_OFF)
 #define petnum_to_glyph(mnum)  ((int) (mnum) + GLYPH_PET_OFF)
 
-/* The hero's glyph when seen as a monster.  Could also be...
- * mon_to_glyph(Upolyd || Race_if(PM_HUMAN) ? u.umonnum : urace.malenum)
+/* The hero's glyph when seen as a monster.
  */
-#define hero_glyph monnum_to_glyph(u.umonnum)
+#define hero_glyph \
+       monnum_to_glyph((Upolyd || !iflags.showrace) ? u.umonnum : \
+                       (flags.female && urace.femalenum != NON_PM) ? urace.femalenum : \
+                       urace.malenum)
 
 
 /*
index b9bb78d208e45b56fea1c39c8534a04482c2fa68..572980753c22ff130265fc137709f6cdc55e83f5 100644 (file)
@@ -1353,7 +1353,6 @@ E char *FDECL(nh_getenv, (const char *));
 E void FDECL(set_duplicate_opt_detection, (int));
 E void FDECL(set_wc_option_mod_status, (unsigned long, int));
 E void FDECL(set_option_mod_status, (char *, int));
-E boolean FDECL(feature_toggle, (int));
 
 /* ### pager.c ### */
 
index ddc607080001e1508fa70c7f0da4716f17b0e15c..c1445f03ebf8f17f6b4540c6ac89072e7fe51820 100644 (file)
@@ -252,6 +252,10 @@ struct instance_flags {
        boolean wc_large_font;          /* draw in larger fonts (say, 12pt instead
                                                of 9pt) */
        boolean wc_eight_bit_input;     /* allow eight bit input               */
+
+       /* Items which belong in flags, but are here to allow save compatibility */
+       boolean  lootabc;       /* use "a/b/c" rather than "o/i/b" when looting */
+       boolean  showrace;      /* show hero glyph by race rather than by role */
 };
 
 /*
index 08d6b57bd8d7de517df86e85dfdcf132b0b64110..69988fe864138ffadf9fc22624ba8018d1829508 100644 (file)
@@ -271,21 +271,6 @@ char *fqn_prefix_names[PREFIX_COUNT] = { "hackdir", "leveldir", "savedir",
                                        "lockdir", "configdir" };
 #endif
 
-/*
- * The following provide a way to offer two different
- * behaviours for a game interface feature, and allow
- * the player to toggle the alternate behaviour on.
- * The strings in the feature_toggles[] array can be
- * specified in an OPTIONS=feature_toggle:value1 value2
- * statement in the config file.
- */
-unsigned long toggled_features = 0L;
-
-struct features_that_toggle feature_toggles[] = {
-       {(char *)0,     0x00000000L},           /*  0 = TOGGLE_INVALID              */
-       {"loot_menu_selectors", 0x00000001L},   /*  1 = TOGGLE_LOOT_MENU_SELECTORS  */
-};
-                       
 /* dummy routine used to force linkage */
 void
 decl_init()
index e8ce17a3d75f3a457ee0756adcfdb166cc9b92a8..1fe7a565d9d1034d8284ec2363ea55d3d41045a8 100644 (file)
@@ -106,6 +106,7 @@ static struct Bool_Opt
        {"large_font", &iflags.wc_large_font, FALSE, SET_IN_FILE},      /*WC*/
        {"legacy", &flags.legacy, TRUE, DISP_IN_GAME},
        {"lit_corridor", &flags.lit_corridor, FALSE, SET_IN_GAME},
+       {"lootabc", &iflags.lootabc, FALSE, SET_IN_GAME},
 #ifdef MAC_GRAPHICS_ENV
        {"Macgraphics", &iflags.MACgraphics, TRUE, SET_IN_GAME},
 #else
@@ -161,6 +162,7 @@ static struct Bool_Opt
 #else
        {"showexp", (boolean *)0, FALSE, SET_IN_FILE},
 #endif
+       {"showrace", &iflags.showrace, FALSE, SET_IN_GAME},
 #ifdef SCORE_ON_BOTL
        {"showscore", &flags.showscore, FALSE, SET_IN_GAME},
 #else
@@ -202,10 +204,6 @@ static struct Comp_Opt
                                                8, DISP_IN_GAME },
        { "align_message", "message window alignment", 20, DISP_IN_GAME },      /*WC*/
        { "align_status", "status window alignment", 20, DISP_IN_GAME },        /*WC*/
-#ifdef MAC
-       { "background", "the color of the background (black or white)",
-                                               6, SET_IN_FILE },
-#endif
        { "boulder",  "the symbol to use for displaying boulders",
                                                1, SET_IN_GAME },
        { "catname",  "the name of your (first) cat (e.g., catname:Tabby)",
@@ -219,7 +217,6 @@ static struct Comp_Opt
                                                MAXDCHARS+1, SET_IN_FILE },
        { "effects",  "the symbols to use in drawing special effects",
                                                MAXECHARS+1, SET_IN_FILE },
-       { "feature_toggle",   "alternate feature behaviour", 79, SET_IN_FILE },
        { "font_map", "the font to use in the map window", 40, DISP_IN_GAME },  /*WC*/
        { "font_menu", "the font to use in menus", 40, DISP_IN_GAME },          /*WC*/
        { "font_message", "the font to use in the message window",
@@ -297,9 +294,6 @@ static struct Comp_Opt
        { "tile_file", "name of tile file", 70, DISP_IN_GAME},  /*WC*/
        { "traps",    "the symbols to use in drawing traps",
                                                MAXTCHARS+1, SET_IN_FILE },
-#ifdef MAC
-       {"use_stone", "use stone background patterns", 8, SET_IN_FILE },
-#endif
        { "vary_msgcount", "show more old messages at a time", 20, DISP_IN_GAME }, /*WC*/
 #ifdef MSDOS
        { "video",    "method of video updating", 20, SET_IN_FILE },
@@ -1042,43 +1036,6 @@ boolean tinitial, tfrom_file;
                return;
        }
 
-       fullname = "feature_toggle";
-       if (match_optname(opts, fullname, 11, TRUE)) {
-               char buf[BUFSZ];
-               char *feature;
-               boolean matched = FALSE;
-               if (!(op = string_for_opt(opts, FALSE)))
-                       return;
-               if (!negated) {
-                   boolean has_badfield = FALSE;
-                   char badfields[BUFSZ];
-                   buf[BUFSZ-1] = '\0';
-
-                   Strcpy(badfields, "feature_toggle:");
-                   (void)strncpy(buf, op, BUFSZ - 1);
-                   (void)mungspaces(buf);
-                   feature = strtok(buf, " \n");
-                   while(feature && *feature && *feature != ' ') {
-                       matched = FALSE;
-                       for (num = 1; num <= LAST_FEATURE_TOGGLE; num++) {
-                           if (!strcmpi(feature, feature_toggles[num].feature_name)) {
-                               toggled_features |= feature_toggles[num].feature_bit;
-                               matched = TRUE;
-                           }
-                       }
-                       if (!matched) {
-                               if (has_badfield) Strcat(badfields, " ");
-                               Strcat(badfields, feature);
-                               has_badfield = TRUE;
-                       }
-                       feature = strtok((char *)0, " \n");
-                   }
-                   if (has_badfield) badoption(badfields);
-               } else
-                       bad_negation(fullname, FALSE);
-               return;
-       }
-
        fullname = "horsename";
        if (match_optname(opts, fullname, 5, TRUE)) {
                if (negated) bad_negation(fullname, FALSE);
@@ -1169,30 +1126,6 @@ boolean tinitial, tfrom_file;
                return;
        }
 #ifdef CHANGE_COLOR
-#ifdef MAC
-       fullname = "use_stone";
-       if (match_optname(opts, fullname, 6, TRUE)) {
-               op = string_for_env_opt(fullname, opts, negated);
-               if ((negated && !op) || (!negated && op)) {
-                       iflags.use_stone = negated ? 0 : atoi(op);
-               } else if (negated) bad_negation(fullname, TRUE);
-               return;
-       }
-
-       fullname = "background";
-       if (match_optname(opts, fullname, 5,TRUE))
-       {
-               if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0)
-               {
-                       if (!strncmpi (op, "white", 5))
-                               change_background (1);
-                       else if (!strncmpi (op, "black", 5))
-                               change_background (0);
-               }
-               return;
-       }
-#endif 
-
        if (match_optname(opts, "palette", 3, TRUE)
 # ifdef MAC
            || match_optname(opts, "hicolor", 3, TRUE)
@@ -2103,10 +2036,9 @@ goodfruit:
                            vision_recalc(2);           /* shut down vision */
                            vision_full_recalc = 1;     /* delayed recalc */
                        }
-                       else if ((boolopt[i].addr) == &iflags.use_inverse) {
-                           need_redraw = TRUE;
-                       }
-                       else if ((boolopt[i].addr) == &iflags.hilite_pet) {
+                       else if ((boolopt[i].addr) == &iflags.use_inverse ||
+                                       (boolopt[i].addr) == &iflags.showrace ||
+                                       (boolopt[i].addr) == &iflags.hilite_pet) {
                            need_redraw = TRUE;
                        }
 #ifdef TEXTCOLOR
@@ -3287,16 +3219,6 @@ char *op;
        return 1;
 }
 
-boolean
-feature_toggle(ftidx)
-int ftidx;
-{
-       if (ftidx > 0 && ftidx <= LAST_FEATURE_TOGGLE) {
-               if (toggled_features & feature_toggles[ftidx].feature_bit)
-                       return TRUE;
-       }
-       return FALSE;
-}
 #endif /* OPTION_LISTS_ONLY */
 
 /*options.c*/
index 9256a47aa0ce3ba884aee54fdacb7ace2533cfe8..42978c9f735188c11be783c1a2dcaa0edbdfc238 100644 (file)
@@ -2202,10 +2202,8 @@ struct obj *obj;
     menu_item *pick_list;
     char buf[BUFSZ];
     int n;
-    char oldmenu[3] = {'a', 'b', 'c'}, newmenu[3] = {'o', 'i', 'b'};
-    char *menuselector = newmenu;
+    char *menuselector = iflags.lootabc ? "abc" : "oib";
 
-    if (feature_toggle(TOGGLE_LOOT_MENU_SELECTORS)) menuselector = oldmenu;
     any.a_void = 0;
     win = create_nhwindow(NHW_MENU);
     start_menu(win);