MCPcopy Create free account
hub / github.com/NetHack/NetHack / tt_reset_color

Function tt_reset_color

win/X11/winstat.c:512–538  ·  view source on GitHub ↗

reset status_hilite for BL_RESET; if highlighting has been disabled or this field is disabled, clear highlighting for this field or condition */

Source from the content-addressed store, hash-verified

510/* reset status_hilite for BL_RESET; if highlighting has been disabled or
511 this field is disabled, clear highlighting for this field or condition */
512static void
513tt_reset_color(
514 int fld,
515 int cond,
516 unsigned long *colormasks)
517{
518 Widget label;
519 int colrattr = NO_COLOR;
520
521 if (fld != BL_CONDITION) {
522 if (iflags.hilite_delta != 0L && status_activefields[fld])
523 colrattr = X11_status_colors[fld];
524 cond = 0;
525 label = X11_status_labels[fld];
526 } else {
527 unsigned long bm = tt_condorder[cond].mask;
528
529 if (iflags.hilite_delta != 0L && (X11_condition_bits & bm) != 0) {
530 /* BL_RESET before first BL_CONDITION will have colormasks==Null
531 but condcolor() and condattr() can cope with that */
532 colrattr = condcolor(bm, colormasks);
533 colrattr |= (condattr(bm, colormasks) << 8);
534 }
535 label = X11_cond_labels[cond];
536 }
537 HiliteField(label, fld, cond, colrattr, (XFontStruct **) 0);
538}
539#endif
540
541/* make sure foreground, background, and font have reasonable values,

Callers 1

X11_status_update_ttyFunction · 0.85

Calls 3

HiliteFieldFunction · 0.85
condcolorFunction · 0.70
condattrFunction · 0.70

Tested by

no test coverage detected