--- src-orig/object1.c Sat Dec 28 14:50:46 2002 +++ src/object1.c Fri Jan 3 22:53:39 2003 @@ -2047,6 +2047,41 @@ int scan_floor(int *items, int size, int return (num); } +byte value_color(int wgt) { + byte attr; + if (wgt / p_ptr->au >= 50000) + { + attr = TERM_VIOLET; + } else if (wgt / p_ptr->au >= 10000) { + attr = TERM_L_BLUE; + } else if (wgt / p_ptr->au >= 5000) { + attr = TERM_BLUE; + } else if (wgt / p_ptr->au >= 2000) { + attr = TERM_L_GREEN; + } else if (wgt / p_ptr->au >= 1000) { + attr = TERM_GREEN; + } else if (wgt / p_ptr->au >= 7500) { + attr = TERM_WHITE; + } else if (wgt / p_ptr->au >= 500) { + attr = TERM_YELLOW; + } else if (wgt / p_ptr->au >= 400) { + attr = TERM_ORANGE; + } else if (wgt / p_ptr->au >= 300) { + attr = TERM_L_RED; + } else if (wgt / p_ptr->au >= 200) { + attr = TERM_RED; + } else if (wgt / p_ptr->au >= 100) { /* 10% */ + attr = TERM_L_UMBER; + } else if (wgt / p_ptr->au >= 50) { + attr = TERM_UMBER; + } else if (wgt / p_ptr->au >= 10) { + attr = TERM_SLATE; + } else { + attr = TERM_L_DARK; + } + return attr; +} + /* * Choice window "shadow" of the "show_inven()" function */ @@ -2119,9 +2154,14 @@ void display_inven(void) /* Display the weight if needed */ if (show_weights && object_weight(o_ptr)) { - int wgt = object_weight(o_ptr) * o_ptr->number; + /* Ugly cheat hack - color the weight by relative value of item to character's money */ + int wgt = object_value(o_ptr) * 100 * o_ptr->number; + attr = TERM_WHITE; + attr = value_color(wgt); + + wgt = object_weight(o_ptr) * o_ptr->number; sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10); - Term_putstr(71, i, -1, TERM_WHITE, tmp_val); + Term_putstr(71, i, -1, attr, tmp_val); } } @@ -2192,10 +2232,16 @@ void display_equip(void) /* Display the weight (if needed) */ if (show_weights && object_weight(o_ptr)) { - int wgt = object_weight(o_ptr) * o_ptr->number; int col = (show_labels ? 52 : 71); + + /* Ugly cheat hack - color the weight by relative value of item to character's money */ + int wgt = object_value(o_ptr) * 100 * o_ptr->number; + attr = TERM_WHITE; + attr = value_color(wgt); + + wgt = object_weight(o_ptr) * o_ptr->number; sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10); - Term_putstr(col, i - INVEN_WIELD, -1, TERM_WHITE, tmp_val); + Term_putstr(col, i - INVEN_WIELD, -1, attr, tmp_val); } } @@ -2317,9 +2363,13 @@ void show_inven(void) /* Display the weight if needed */ if (show_weights) { - int wgt = object_weight(o_ptr) * o_ptr->number; + /* Ugly cheat hack - color the weight by relative value of item to character's money */ + int wgt = object_value(o_ptr) * 100 * o_ptr->number; + out_color[j] = value_color(wgt); + + wgt = object_weight(o_ptr) * o_ptr->number; sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10); - put_str(tmp_val, j + 1, 71); + c_put_str(out_color[j], tmp_val, j + 1, 71); } } @@ -2437,9 +2487,13 @@ void show_equip(void) /* Display the weight if needed */ if (show_weights) { - int wgt = object_weight(o_ptr) * o_ptr->number; + /* Ugly cheat hack - color the weight by relative value of item to character's money */ + int wgt = object_value(o_ptr) * 100 * o_ptr->number; + out_color[j] = value_color(wgt); + + wgt = object_weight(o_ptr) * o_ptr->number; sprintf(tmp_val, "%3d.%d lb", wgt / 10, wgt % 10); - put_str(tmp_val, j+1, 71); + c_put_str(out_color[j], tmp_val, j+1, 71); } } --- src-orig/store.c Mon Dec 30 16:09:36 2002 +++ src/store.c Wed Jan 1 04:12:03 2003 @@ -1102,10 +1102,14 @@ static void display_entry(int item) /* Show weights */ if (show_weights) { + /* That money color cheat */ + int wgt = object_value(o_ptr) * 100 * o_ptr->number; + attr = value_color(wgt); + /* Only show the weight of a single object */ - int wgt = object_weight(o_ptr); + wgt = object_weight(o_ptr); sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10); - put_str(out_val, y, 68); + c_put_str(attr, out_val, y, 68); } }