Skip to content

Tooltips hide zero-valued properties.

Item tooltips check if fields exist o.foo rather than if those fields are meaningfully valued, while actors typically check if they exist and are nonzero (self:attr("foo")). This causes a range of display issues from meaningless information (Critical Chance: 0.0%) to the misleading (for special properties like undead-ness and blind-fight). These are most apparent when tinkers are added and removed from objects, because the stats that were uniquely provided by the tinker will remain as +0 on the object. This is most egregious on T4 and T5 Focus Lenses, which grant the blind_fight property. This is properly removed when the tinker is, but the item tooltip will continue to imply that blind fight is granted.

Rather than adjust the tinkering subsystem, this is a safer method that doesn't run the risk of breaking objects that may expect fields to exist and be real valued.

This MR adjusts the tooltip display functions to not display properties that are zero-valued. This includes raw values of the combat and wielder tables (e.g. combat.apr) and subvalues of tables like melee_project or inc_damage (e.g. inc_damage.FIRE). This also adjusts all special properties (blind_fight, lucid_dreamer, sleep, no_breath, etc.) to require a nonzero value to be displayed on the tooltip, just as they require a nonzero value on the actor to apply.

This MR is save-safe.

Merge request reports