This isn't really Nick C's original patch.  However, I took out all
the artifacts from config.h and also added the documentation to the
Guidebook, so this one is better.  I also removed the compile-time
directive that enabled it, since I handle that separately.

Do with it what you will.

--Jason Short



Index: doc/Guidebook.mn
===================================================================
RCS file: /home/jshort/cvs/patch_hack/doc/Guidebook.mn,v
retrieving revision 1.8
diff -c -r1.8 Guidebook.mn
*** doc/Guidebook.mn	2001/04/17 05:12:51	1.8
--- doc/Guidebook.mn	2001/04/17 06:53:41
***************
*** 1940,1945 ****
--- 1940,1947 ----
  Show your accumulated experience points on bottom line (default off).
  .lp showscore
  Show your approximate accumulated score on bottom line (default off).
+ .lp showweight
+ Show your inventory weight on bottom line (if compiled in).
  .lp "silent  "
  Suppress terminal beeps (default on).
  .lp sortpack
Index: doc/Guidebook.tex
===================================================================
RCS file: /home/jshort/cvs/patch_hack/doc/Guidebook.tex,v
retrieving revision 1.8
diff -c -r1.8 Guidebook.tex
*** doc/Guidebook.tex	2001/04/17 05:12:51	1.8
--- doc/Guidebook.tex	2001/04/17 06:54:06
***************
*** 2393,2398 ****
--- 2393,2400 ----
  %.lp
  \item[\ib{showscore}]
  Show your approximate accumulated score on bottom line (default off).
+ \item[\ib{showweight}\
+ Show your inventory weight on bottom line (if compiled in).
  %.lp
  \item[\ib{silent}]
  Suppress terminal beeps (default on).
Index: doc/Guidebook.txt
===================================================================
RCS file: /home/jshort/cvs/patch_hack/doc/Guidebook.txt,v
retrieving revision 1.5
diff -c -r1.5 Guidebook.txt
*** doc/Guidebook.txt	2001/04/13 02:14:18	1.5
--- doc/Guidebook.txt	2001/04/17 06:53:35
***************
*** 2531,2536 ****
--- 2531,2539 ----
                 Show your approximate accumulated score on bottom line  (de-
                 fault off).
  
+           showweight
+                Show your inventory weight on bottom line (if compiled in).
+ 
            silent
                 Suppress terminal beeps (default on).
  
Index: include/flag.h
===================================================================
RCS file: /home/jshort/cvs/patch_hack/include/flag.h,v
retrieving revision 1.5
diff -c -r1.5 flag.h
*** include/flag.h	2001/04/13 02:27:31	1.5
--- include/flag.h	2001/04/17 06:45:24
***************
*** 74,79 ****
--- 74,80 ----
  #ifdef SCORE_ON_BOTL
  	boolean  showscore;	/* show score */
  #endif
+ 	boolean  showweight;
  	boolean  silent;	/* whether the bell rings or not */
  	boolean  sortpack;	/* sorted inventory */
  	boolean  soundok;	/* ok to tell about sounds heard */
Index: src/botl.c
===================================================================
RCS file: /home/jshort/cvs/patch_hack/src/botl.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 botl.c
*** src/botl.c	2001/04/13 01:55:46	1.1.1.1
--- src/botl.c	2001/04/17 06:45:24
***************
*** 259,264 ****
--- 259,267 ----
  	else
  		Sprintf(nb = eos(nb), " Exp:%u", u.ulevel);
  
+ 	if(flags.showweight)
+ 		Sprintf(nb = eos(nb), " Wt:%ld/%ld", (long)(inv_weight()+weight_cap()), (long)(weight_cap()));
+ 
  	if(flags.time)
  	    Sprintf(nb = eos(nb), " T:%ld", moves);
  	if(strcmp(hu_stat[u.uhs], "        ")) {
Index: src/options.c
===================================================================
RCS file: /home/jshort/cvs/patch_hack/src/options.c,v
retrieving revision 1.8
diff -c -r1.8 options.c
*** src/options.c	2001/04/17 05:12:51	1.8
--- src/options.c	2001/04/17 06:45:24
***************
*** 178,183 ****
--- 178,184 ----
  #else
  	{"showscore", (boolean *)0, FALSE},
  #endif
+ 	{"showweight", &flags.showweight, FALSE},
  	{"silent", &flags.silent, TRUE},
  	{"sortpack", &flags.sortpack, TRUE},
  	{"sound", &flags.soundok, TRUE},
Index: util/makedefs.c
===================================================================
RCS file: /home/jshort/cvs/patch_hack/util/makedefs.c,v
retrieving revision 1.31
diff -c -r1.31 makedefs.c
*** util/makedefs.c	2001/04/17 05:12:51	1.31
--- util/makedefs.c	2001/04/17 06:46:29
***************
*** 732,737 ****
--- 732,738 ----
  #ifdef PREADJUST_OPTION
  		"patch: preadjusting inventory order",
  #endif /* PREADJUST_OPTION */
+ 		"patch: inventory weight on status line",
  #ifdef REDO
  		"redo command",
  #endif
Index: win/X11/winstat.c
===================================================================
RCS file: /home/jshort/cvs/patch_hack/win/X11/winstat.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 winstat.c
*** win/X11/winstat.c	2001/04/13 01:55:51	1.1.1.1
--- win/X11/winstat.c	2001/04/17 06:45:24
***************
*** 229,244 ****
  #define F_ALIGN	   16
  #define F_TIME     17
  #define F_SCORE	   18
  
! #define F_HUNGER   19
! #define F_CONFUSED 20
! #define F_SICK	   21
! #define F_BLIND	   22
! #define F_STUNNED  23
! #define F_HALLU    24
! #define F_ENCUMBER 25
  
! #define NUM_STATS  26
  
  /*
   * Notes:
--- 229,246 ----
  #define F_ALIGN	   16
  #define F_TIME     17
  #define F_SCORE	   18
+ #define F_WEIGHT   19 /* showweight by nickca@io.com */
+ #define F_MAXWGT   20 /* showweight by nickca@io.com */
  
! #define F_HUNGER   21
! #define F_CONFUSED 22
! #define F_SICK	   23
! #define F_BLIND	   24
! #define F_STUNNED  25
! #define F_HALLU    26
! #define F_ENCUMBER 27
  
! #define NUM_STATS  28
  
  /*
   * Notes:
***************
*** 267,272 ****
--- 269,276 ----
      { "Alignment",	SV_VALUE, (Widget) 0, -2, 0, FALSE, FALSE },
      { "Time",		SV_VALUE, (Widget) 0, -1, 0, FALSE, FALSE },
      { "Score",		SV_VALUE, (Widget) 0, -1, 0, FALSE, FALSE },
+     { "Weight",		SV_VALUE, (Widget) 0, -1, 0, FALSE, FALSE }, /*showweight*/
+     { "Max Wgt",	SV_VALUE, (Widget) 0, -1, 0, FALSE, FALSE }, /*showweight*/
  
      { "",		SV_NAME,  (Widget) 0, -1, 0, FALSE, TRUE }, /* hunger*/
      { "Confused",	SV_NAME,  (Widget) 0,  0, 0, FALSE, TRUE },	/*20*/
***************
*** 474,479 ****
--- 478,498 ----
  #endif
  	}
  
+     /* special case: showweight. added by nickca@io.com */
+ 	else if (attr_rec == &shown_stats[F_WEIGHT]) {
+ 	    static boolean flagweight = TRUE;
+ 	    if(flags.showweight && !flagweight) {
+ 		set_name(attr_rec->w, shown_stats[F_WEIGHT].name);
+ 		force_update = TRUE;
+ 		flagweight = flags.showweight;
+ 	    } else if(!flags.showweight && flagweight) {
+ 		set_name(attr_rec->w, "");
+ 		set_value(attr_rec->w, "");
+ 		flagweight = flags.showweight;
+ 	    }
+ 	    if(!flagweight) return;
+ 	}
+ 
  	/* special case: when polymorphed, show "HD", disable exp */
  	else if (attr_rec == &shown_stats[F_LEVEL]) {
  	    static boolean lev_was_poly = FALSE;
***************
*** 624,629 ****
--- 643,650 ----
  #else
  	    case F_SCORE:	val = 0L; break;
  #endif
+ 	    case F_WEIGHT:	val = flags.showweight ? (long)(inv_weight()+weight_cap()):0L; break;
+ 	    case F_MAXWGT:	val = flags.showweight ? (long)(weight_cap()):0L; break;
  	    default:
  	    {
  		/*
***************
*** 706,711 ****
--- 727,734 ----
  	case F_ALIGN:	return "Neutral";
  	case F_TIME:	return "4294967295";	/* max ulong */
  	case F_SCORE:	return "4294967295";	/* max ulong */
+ 	case F_WEIGHT:	return "9999"; /* showweight, by nickca@io.com */
+ 	case F_MAXWGT:	return "9999"; /* showweight, by nickca@io.com */
      }
      impossible("width_string: unknown index %d\n", sv_index);
      return "";
***************
*** 863,871 ****
  				F_STUNNED, F_HALLU, F_ENCUMBER, -1,0,0 };
  
  static int col2_indices[] = { F_MAXHP,    F_ALIGN, F_TIME, F_EXP,
! 			      F_MAXPOWER, -1,0,0 };
  static int col1_indices[] = { F_HP,       F_AC,    F_GOLD, F_LEVEL,
! 			      F_POWER,    F_SCORE, -1,0,0 };
  
  
  /*
--- 886,894 ----
  				F_STUNNED, F_HALLU, F_ENCUMBER, -1,0,0 };
  
  static int col2_indices[] = { F_MAXHP,    F_ALIGN, F_TIME, F_EXP,
! 			      F_MAXPOWER, F_MAXWGT, -1,0,0 };
  static int col1_indices[] = { F_HP,       F_AC,    F_GOLD, F_LEVEL,
! 			      F_POWER, F_WEIGHT, F_SCORE, -1,0,0 };
  
  
  /*

