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:
@@ -74,6 +74,9 @@ struct window_procs {
|
||||
void NDECL((*win_status_finish));
|
||||
void FDECL((*win_status_enablefield), (int,const char *,const char *,BOOLEAN_P));
|
||||
void FDECL((*win_status_update), (int,genericptr_t,int,int));
|
||||
# ifdef STATUS_HILITES
|
||||
void FDECL((*win_status_threshold), (int,int,anything,int,int,int));
|
||||
# endif
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -152,6 +155,9 @@ extern NEARDATA struct window_procs windowprocs;
|
||||
*/
|
||||
#define status_enablefield (*windowprocs.win_status_enablefield)
|
||||
#define status_update (*windowprocs.win_status_update)
|
||||
#ifdef STATUS_HILITES
|
||||
#define status_threshold (*windowprocs.win_status_threshold)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -195,8 +201,9 @@ extern NEARDATA struct window_procs windowprocs;
|
||||
|
||||
#define WC2_FULLSCREEN 0x01L /* 01 display full screen */
|
||||
#define WC2_SOFTKEYBOARD 0x02L /* 02 software keyboard */
|
||||
#define WC2_WRAPTEXT 0x04L /* 04 wrap long lines of text */
|
||||
/* 29 free bits */
|
||||
#define WC2_WRAPTEXT 0x04L /* 03 wrap long lines of text */
|
||||
#define WC2_HILITE_STATUS 0x08L /* 04 hilite fields in status */
|
||||
/* 28 free bits */
|
||||
|
||||
#define ALIGN_LEFT 1
|
||||
#define ALIGN_RIGHT 2
|
||||
|
||||
Reference in New Issue
Block a user