core support for status field highlighting (trunk only)

This provides the core support needed for status field highlighting.
This patch doesn't actually perform status field highlighting for any port,
but provides the core hooks for doing so.

The syntax is:
OPTIONS=hilite_status:{fieldname}/{threshold}/{below}/{above}
where {fieldname} is the name of a status field.
           {threshold} is the value used as the threshold to trigger a display
                             change.  It can also be set to "updown" to trigger
                             a display change whenever it rises or whenever it falls.
                             If you end the threshold value with %, then it signifies
                             that you want to trigger the display change based on the
                             percentage of maximum.
         {below}, {above}
                        are the color or display attribute that you want to use when
                        the field value is underneath the threshold. Supported display
                        fields are:  normal, inverse, bold, black, red, green,
                                         brown, blue, magenta, cyan, gray, orange,
                                         bright-green, yellow, bright-blue, bright-magenta,
                                         bright-cyan, or white.
Valid field names are:
        alignment, armor-class, carrying-capacity,
        charisma, condition, constitution, dexterity,
        dungeon-level, experience-level, experience,
        gold, HD, hitpoints-max, hitpoints, hunger,
        intelligence, power-max, power, score,
        strength, time, title, wisdom

Refer to window.doc for details. Guidebook updates to come later.
This commit is contained in:
nethack.allison
2003-11-30 05:51:53 +00:00
parent c1c4ba99d9
commit 10480f4397
21 changed files with 997 additions and 195 deletions

View File

@@ -5,6 +5,8 @@
#ifndef BOTL_H
#define BOTL_H
#ifdef STATUS_VIA_WINDOWPORT
#define BL_FLUSH -1
#define BL_TITLE 0
#define BL_STR 1
@@ -43,4 +45,20 @@
#define REASSESS_ONLY TRUE
#ifdef STATUS_HILITES
/* hilite status field behavior - coloridx values */
#define BL_HILITE_NONE -1 /* no hilite of this field */
#define BL_HILITE_INVERSE -2 /* inverse hilite */
#define BL_HILITE_BOLD -3 /* bold hilite */
/* or any CLR_ index (0 - 15) */
#define BL_TH_NONE 0
#define BL_TH_VAL_PERCENTAGE 100 /* threshold is percentage */
#define BL_TH_VAL_ABSOLUTE 101 /* threshold is particular value */
#define BL_TH_UPDOWN 102 /* threshold is up or down change */
#define BL_TH_CONDITION 103 /* threshold is bitmask of conditions */
#endif
extern const char *status_fieldnames[]; /* in botl.c */
#endif
#endif /* BOTL_H */