character_sheet templateclient
Lumen template defined in plugin/views/lumen/character_sheet.lumen
Part of Character Stats
The character sheet of the local player, the first page of the tab menu: a card with two
columns. The left one holds the name and the faction of the character, its level and the
experience toward the next one, its health and the skill and attribute points it has not
spent yet, followed by the stats with their level names and modifiers. The right one lists
the skills grouped under their key stats, each with its rank, its total modifier and what
that modifier is made of. Every stat and skill has a button that asks the server to roll it
and show the result in the chat (Stats:request_roll), which tumbles until the result is
back and then shows its total for a few seconds (roll_button, see cl_roll_button.lua),
and while points are left a button that spends one on it ('fl_levels_spend_attribute',
'fl_levels_spend_skill'). Stats that Attributes.is_visible hides and skills that
Skills.is_visible hides are left out. The level, the experience and the points come from
the Levels plugin and are not shown without it; the faction comes from the Factions plugin.
Summary
Functions
stat_order, with stats that are not in that list after them, sorted by name.Functions
A bar that is filled to a fraction.
Parameters
- props Map fraction (Number from 0 to 1), color (String/Color of the filled part)
Returns
- Map the element
Groups the skills the local player sees under their key stats, in the order of the stats. Skills whose key stat is not registered come last, under a group of their own.
Parameters
- actor Player
- stats List<AttributeBase> the stats, as get_stats returns them
Returns
- List<Map> groups: id (String), title (String) and skills (List<SkillBase>)
Returns the stats the local player sees, in the order of stat_order, with stats that
are not in that list after them, sorted by name.
Parameters
- actor Player
Returns
- List<AttributeBase>
The name, the faction, the level, the experience, the health and the unspent points of the character. A character at the level cap of the server level sees the time until the cap rises in place of its experience.
Parameters
- props Map actor (Player)
Returns
- Map the element
The icon of a stat or a skill: a FontAwesome icon if its name starts with 'fa-', otherwise an image, or an empty space of the same size if it has none.
Parameters
- props Map icon (String), size (Number), font (String font whose height is the size of a FontAwesome icon)
Returns
- Map the element
A label with a value at its right end.
Parameters
- props Map label (String), value (String), color (String/Color of the value)
Returns
- Map the element
A notice in place of a list that is empty.
Parameters
- props Map text (String)
Returns
- Map the element
The button that asks the server to roll a stat or a skill and shows the result once it is back. It is wide enough for a total, so that it keeps its size while it shows one.
Parameters
- props Map id (String ID of the stat or the skill)
Returns
- Map the element
Formats a modifier with its sign: '+2', '-1', '+0'.
Parameters
- value Number
Returns
- String
The line of a skill.
Parameters
- props Map actor (Player), skill (SkillBase), can_spend (Boolean whether the character has skill points left)
Returns
- Map the element
Sorts stat or skill definitions by their translated names, and by their IDs when the names are the same.
Parameters
- list List<AttributeBase/SkillBase> sorted in place
Returns
- List<AttributeBase/SkillBase> the same list
The button that spends an unspent point on a stat or a skill.
Parameters
- props Map message (String Cable message to send), id (String ID of the stat or the skill), tooltip (String)
Returns
- Map the element
The line of a stat.
Parameters
- props Map actor (Player), stat (AttributeBase), can_spend (Boolean whether the character has attribute points left)
Returns
- Map the element