Hilite Status: Improved

Allow defining multiple stops per field. Add hitpointbar.
This commit is contained in:
Pasi Kallinen
2017-09-26 10:04:19 +03:00
parent cac4344754
commit 69f7a78dba
37 changed files with 3227 additions and 1532 deletions

View File

@@ -474,9 +474,7 @@ static short FDECL(hup_set_font_name, (winid, char *));
#endif
static char *NDECL(hup_get_color_string);
#endif /* CHANGE_COLOR */
#ifdef STATUS_VIA_WINDOWPORT
static void FDECL(hup_status_update, (int, genericptr_t, int, int));
#endif
static void FDECL(hup_status_update, (int, genericptr_t, int, int, int, unsigned long *));
static int NDECL(hup_int_ndecl);
static void NDECL(hup_void_ndecl);
@@ -526,14 +524,9 @@ static struct window_procs hup_procs = {
hup_void_ndecl, /* end_screen */
hup_outrip, genl_preference_update, genl_getmsghistory,
genl_putmsghistory,
#ifdef STATUS_VIA_WINDOWPORT
hup_void_ndecl, /* status_init */
hup_void_ndecl, /* status_finish */
genl_status_enablefield, hup_status_update,
#ifdef STATUS_HILITES
genl_status_threshold,
#endif
#endif /* STATUS_VIA_WINDOWPORT */
genl_can_suspend_no,
};
@@ -762,17 +755,17 @@ hup_get_color_string(VOID_ARGS)
}
#endif /* CHANGE_COLOR */
#ifdef STATUS_VIA_WINDOWPORT
/*ARGSUSED*/
static void
hup_status_update(idx, ptr, chg, percent)
hup_status_update(idx, ptr, chg, pc, color, colormasks)
int idx UNUSED;
genericptr_t ptr UNUSED;
int chg UNUSED, percent UNUSED;
int chg UNUSED, pc UNUSED, color UNUSED;
unsigned long *colormasks UNUSED;
{
return;
}
#endif /* STATUS_VIA_WINDOWPORT */
/*
* Non-specific stubs.
@@ -816,7 +809,6 @@ const char *string UNUSED;
#endif /* HANGUPHANDLING */
#ifdef STATUS_VIA_WINDOWPORT
/****************************************************************************/
/* genl backward compat stuff */
@@ -871,10 +863,11 @@ boolean enable;
/* call once for each field, then call with BL_FLUSH to output the result */
void
genl_status_update(idx, ptr, chg, percent)
genl_status_update(idx, ptr, chg, percent, color, colormasks)
int idx;
genericptr_t ptr;
int chg UNUSED, percent UNUSED;
int chg UNUSED, percent UNUSED, color UNUSED;
unsigned long *colormasks UNUSED;
{
char newbot1[MAXCO], newbot2[MAXCO];
long cond, *condptr = (long *) ptr;
@@ -912,12 +905,17 @@ int chg UNUSED, percent UNUSED;
BL_LEVELDESC, BL_GOLD, BL_XP, BL_EXP, BL_HD, BL_TIME, BL_FLUSH },
};
/* in case interface is using genl_status_update() but has not
specified WC2_FLUSH_STATUS (status_update() for field values
is buffered so final BL_FLUSH is needed to produce output) */
windowprocs.wincap2 |= WC2_FLUSH_STATUS;
if (idx != BL_FLUSH) {
if (!status_activefields[idx])
return;
switch (idx) {
case BL_CONDITION:
cond = *condptr;
cond = condptr ? *condptr : 0L;
nb = status_vals[idx];
*nb = '\0';
if (cond & BL_MASK_STONE)
@@ -949,7 +947,8 @@ int chg UNUSED, percent UNUSED;
break;
default:
Sprintf(status_vals[idx],
status_fieldfmt[idx] ? status_fieldfmt[idx] : "%s", text);
status_fieldfmt[idx] ? status_fieldfmt[idx] : "%s",
text ? text : "");
break;
}
return; /* processed one field other than BL_FLUSH */
@@ -1035,18 +1034,6 @@ int chg UNUSED, percent UNUSED;
putmixed(WIN_STATUS, 0, newbot2); /* putmixed() due to GOLD glyph */
}
#ifdef STATUS_HILITES
void
genl_status_threshold(fldidx, thresholdtype, threshold, behavior, under, over)
int fldidx UNUSED, thresholdtype UNUSED;
anything threshold UNUSED;
int behavior UNUSED, under UNUSED, over UNUSED;
{
return;
}
#endif /* STATUS_HILITES */
#endif /* STATUS_VIA_WINDOWPORT */
STATIC_VAR struct window_procs dumplog_windowprocs_backup;
STATIC_VAR FILE *dumplog_file;