garrynewman/garrysmod — pull request #620 by MyHatStinks (2014-02-28 23:36:24+00:00)
Title: TTT: Added Scoreboard hooks

This creates hooks for developers wanting to edit the scoreboard. Allows adding additional columns, and adding options a right-click menu. This means people will no longer need to overwrite the default files to add these, meaning a lot better compatibility between addons.

New hooks:
"TTTScoreboardColumns" -- 2 arguments, Panel (the panel to add the column to) and Type (which type of panel it is, see Enums below)
"TTTScoreboardMenu" -- This one's simpler, one argument, a Menu panel. Return true to hide the menu.

Enums:
These are used as a way to differentiate between what's calling the TTTScoreboardColumns hook.
TTT_COLUMN_HEADING -- It's a column heading
TTT_COLUMN_ROW -- It's a column row, ie the actual data
TTT_COLUMN_BACKGROUND -- It's the background counting the columns

New functions:
PANEL:AddPanel( label, func ) -- Label is the column heading. Function has arguments Player, Panel, and returns a string for the value to be displayed. AddPanel returns a dlabel panel, or nil. See the example below.

Usage example:
http://pastebin.com/8hCzWL9g
![2014-02-28_00003](https://f.cloud.github.com/assets/2471776/2299620/64e83d74-a0d0-11e3-984e-221302b35de8.jpg)