The attribute list (fl_attributes): a scrollable list with a header for every category of attributes and every key stat of skills, and an fl_attribute_row for every attribute and skill that is visible to the player. By default it shows the attributes and skills of the local player and keeps them current while it is open; after set_snapshot it shows the data it was given instead, hidden attributes and skills included. rebuild recreates the list. Derives from fl_base_panel.

Summary

Methods

Returns the data the list shows for an attribute.
Returns the listed attributes and skills as one string, which changes whenever an attribute or a skill appears in the list, disappears from it or moves, or the row of an attribute gains or loses its line of details.
Returns the rank the list shows for a skill.
Collects the attributes and skills to list, grouped into sections.
Returns the player whose attributes and skills the list shows.
Init()client
Creates the scroll panel that holds the list.
Draws the card and the title of the list, unless the active theme's PaintAttributesMenu method does it.
Keeps the list inside the padding of the panel.
rebuild()client
Recreates the list: a header for every section followed by the rows of its attributes and skills, or a notice if there is nothing to show.
Makes the list show the given attribute data and skill ranks of a player instead of the live attributes and skills of the local player.
Think()client
Brings the list up to date twice a second.
update()client
Brings the list up to date with the data it shows: rebuilds it if the set of listed attributes and skills has changed, otherwise passes every attribute row its current data and every skill row its current rank.

Methods

PANEL:get_data(attribute_id)

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

Returns the data the list shows for an attribute.

Parameters

  • attribute_id String

Returns

  • Map level and boosts; nil if there is no data

PANEL:get_listed(sections)

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

Returns the listed attributes and skills as one string, which changes whenever an attribute or a skill appears in the list, disappears from it or moves, or the row of an attribute gains or loses its line of details.

Parameters

  • sections List<Map> sections returned by get_sections

Returns

  • String

PANEL:get_rank(skill_id)

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

Returns the rank the list shows for a skill.

Parameters

  • skill_id String

Returns

  • Number rank, 0 if there is none

Collects the attributes and skills to list, grouped into sections. The sections of the attributes come first, one for every category, sorted by name; then the sections of the skills, one for every key stat, in the alphabetical order of the stat names; skills whose key stat is not registered come last, under a section of their own. The entries of a section are sorted by name.

Returns

  • List<Map> sections: name (String header text), attributes (List<AttributeBase>) and skills (List<SkillBase>)

Returns the player whose attributes and skills the list shows.

Returns

  • Player the player of the snapshot, otherwise the local player

Creates the scroll panel that holds the list.

Draws the card and the title of the list, unless the active theme's PaintAttributesMenu method does it. A list that shows a snapshot draws nothing, as it sits inside a frame.

Parameters

  • w Number panel width
  • h Number panel height

PANEL:PerformLayout(w, h)

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

Keeps the list inside the padding of the panel.

Parameters

  • w Number panel width
  • h Number panel height

Recreates the list: a header for every section followed by the rows of its attributes and skills, or a notice if there is nothing to show.

PANEL:set_snapshot(target, attributes, skills)

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

Makes the list show the given attribute data and skill ranks of a player instead of the live attributes and skills of the local player. Hidden attributes and skills are listed too. Call rebuild afterwards.

Parameters

  • target Player player the data belongs to
  • attributes Map attribute data keyed by attribute ID, as Player:get_attributes returns it
  • skills Map optional, defaults to nil Number ranks keyed by skill ID, as Player:get_skills returns it

Brings the list up to date twice a second.

Brings the list up to date with the data it shows: rebuilds it if the set of listed attributes and skills has changed, otherwise passes every attribute row its current data and every skill row its current rank.

Defined in