The line of one attribute or skill in the attribute list (fl_attribute_row). The line of an attribute shows its icon and name, its level with boosts counted (as the name of the level if the attribute names its levels), a bar that shows where the level lies between the attribute's min and max with the boosted part in another color, and a line that lists the boosts with the time each has left. The description of the attribute, of its current level and its effects are the tooltip of the row. The line of a skill shows its icon and name, its rank (as the name of the rank if the skill names its ranks) and a bar that shows where the rank lies between 0 and the skill's highest rank. The description of the skill and of its current rank are the tooltip of the row. Assign an attribute with set_attribute and its data with set_data, or a skill with set_skill and its rank with set_rank. Derives from fl_base_panel.

Summary

Methods

Builds the tooltip of the row: the description of the attribute or the skill, the description of the given level or rank if there is one, and the effects an attribute lists.
Returns the attribute this row shows.
Returns the height the row needs: taller if it has a line of details.
Returns the skill this row shows.
Init()client
Picks the color of the line of details, the muted text color of the theme.
Draws the row: its background, a FontAwesome icon if the attribute or the skill has one, the name and the level or rank, the bar and the line of details.
Places the image of the icon in the top left corner of the row.
Sets the attribute this row shows and creates its icon.
Sets the data of the attribute and brings the row up to date with it.
Creates the icon of the row.
Sets the rank of the skill and brings the row up to date with it.
Sets the skill this row shows and creates its icon.
update()client
Recalculates what the row shows from its skill and rank or from its attribute and data.
Recalculates what the row of an attribute shows from its data: the texts, the fractions of the bars and, when the level has changed, the tooltip.
Recalculates what the row of a skill shows from its rank: the texts, the fraction of the bar and, when the rank has changed, the tooltip.

Methods

PANEL:build_tooltip(level)

client plugins/stats/plugin/views/cl_attributes.lua:623

Builds the tooltip of the row: the description of the attribute or the skill, the description of the given level or rank if there is one, and the effects an attribute lists.

Parameters

  • level Number level the tooltip is for, boosts counted, or rank of a skill

Returns

  • String

Returns the attribute this row shows.

Returns

  • AttributeBase the attribute definition, or false if the row shows none

PANEL:get_row_height()

client plugins/stats/plugin/views/cl_attributes.lua:614

Returns the height the row needs: taller if it has a line of details.

Returns

  • Number

Returns the skill this row shows.

Returns

  • SkillBase the skill definition, or false if the row shows none

Picks the color of the line of details, the muted text color of the theme.

Draws the row: its background, a FontAwesome icon if the attribute or the skill has one, the name and the level or rank, the bar and the line of details. The active theme's PaintAttributeRow method replaces all of it by returning a value.

Parameters

  • w Number panel width
  • h Number panel height

PANEL:PerformLayout(_w, _h)

client plugins/stats/plugin/views/cl_attributes.lua:446

Places the image of the icon in the top left corner of the row.

Parameters

  • _w Number panel width
  • _h Number panel height

PANEL:set_attribute(attribute_table)

client plugins/stats/plugin/views/cl_attributes.lua:563

Sets the attribute this row shows and creates its icon.

Parameters

  • attribute_table AttributeBase attribute definition

Sets the data of the attribute and brings the row up to date with it.

Parameters

  • data Map level and boosts of the attribute; nil or false shows the attribute at its default level

Creates the icon of the row. An icon that starts with 'fa-' is drawn as a FontAwesome icon, any other is loaded as an image.

Parameters

  • icon String optional, defaults to nil FontAwesome icon name or path of an image

Sets the rank of the skill and brings the row up to date with it.

Parameters

  • rank Number rank of the skill; anything else shows rank 0

PANEL:set_skill(skill_table)

client plugins/stats/plugin/views/cl_attributes.lua:574

Sets the skill this row shows and creates its icon.

Parameters

  • skill_table SkillBase skill definition

Recalculates what the row shows from its skill and rank or from its attribute and data. Does nothing if neither is set.

PANEL:update_attribute()

client plugins/stats/plugin/views/cl_attributes.lua:716

Recalculates what the row of an attribute shows from its data: the texts, the fractions of the bars and, when the level has changed, the tooltip.

Recalculates what the row of a skill shows from its rank: the texts, the fraction of the bar and, when the rank has changed, the tooltip.

Defined in