The card of one player on the scoreboard (fl_scoreboard_player): their avatar, name and ping. Assign the player with set_player, which also builds the card. Plugins add their own elements in the RebuildScoreboardPlayerCard hook. A click on the card opens a menu of things to do with the player (open_menu), which plugins fill in the CreateScoreboardPlayerMenu hook.

Summary

Methods

Opens the menu of the card's player when the card is clicked with the left or the right mouse button.
Builds the menu of things to do with the card's player through the CreateScoreboardPlayerMenu hook and opens it at the cursor.
Draws the background of the player card through the theme's PaintScoreboardPlayer hook.
rebuild()client
Recreates the avatar, name and ping labels for the card's player and runs the RebuildScoreboardPlayerCard hook.
Sets the player this card represents and rebuilds the card.

Methods

PANEL:OnMousePressed(code)

client packages/active_ui/views/cl_scoreboard.lua:151

Opens the menu of the card's player when the card is clicked with the left or the right mouse button. Children of the card that take clicks themselves, such as the avatar, keep their own behavior.

Parameters

  • code Number mouse button code, one of the MOUSE_ enums

Builds the menu of things to do with the card's player through the CreateScoreboardPlayerMenu hook and opens it at the cursor. No menu is shown if no handler has added an option.

Returns

  • Panel the opened DermaMenu, or nil if there is nothing to show

Draws the background of the player card through the theme's PaintScoreboardPlayer hook.

Parameters

  • w Number panel width
  • h Number panel height

Recreates the avatar, name and ping labels for the card's player and runs the RebuildScoreboardPlayerCard hook. Does nothing if no player is set.

PANEL:set_player(target)

client packages/active_ui/views/cl_scoreboard.lua:207

Sets the player this card represents and rebuilds the card.

Parameters

  • target Player

Defined in