Skip to content

API Reference

shmitzas edited this page Nov 10, 2026 · 2 revisions

API Reference

Two ways another plugin reaches CustomHUD: the CustomHUD.Panels.v1 shared interface, which shows panels, and directives, which a menu sends in raw nodes. Getting the interface, and sending directives: API Integration.


Panels

ICustomHudPanels in CustomHUD.Contract.dll, namespace CustomHUD.Contract, key CustomHUD.Panels.v1 (ICustomHudPanels.InterfaceKey). Every member is safe from any thread; Show and the Hide calls take effect on the next tick.

Member Description
IReadOnlyCollection<string> Profiles { get; } Panel names from the server's Panels config
bool Show(int playerId, string profile, IReadOnlyDictionary<string, string> variables, IEnumerable<string>? classes = null, float? durationSeconds = null) Show or update a panel for one player. false for an unknown panel, or one without a File
void Hide(int playerId, string profile) Hide one panel for one player
void HideAll(int playerId) Hide every panel the player has open
void HideEverywhere(string profile) Hide one panel for every player
  • variables: a variable left out keeps its last value. Clear one with "".
  • classes: null keeps the classes from the last Show; any other collection replaces them, so [] clears them.
  • durationSeconds: null uses the panel's DurationSeconds; 0 or less keeps it up until hidden.
  • Panel names are case-insensitive.
  • A player without a SteamID — a bot, or anyone Steam has not yet authorised — gets nothing, and Show still returns true.
  • A panel whose layout the player's Workshop addon lacks draws nothing, and Show still returns true.
  • Until CustomHUD has loaded, Profiles is empty and Show returns false.

Shipped panels

Panel Variables Classes
versus team1, team2, score1, score2, status, detail live
ready title, count, state, hint is-ready, not-ready
timeout title, team, timer, detail team-ct, team-t

Directives

A component sends directives in a raw node addressed to CustomHUD. Every other renderer ignores the node.

new MenuRawNode("customhud.panorama", "icon=7;danger")
  • Directives are separated by ;, so a text value runs to the next ;.
  • A value that becomes a class name — at=, view=, group=, the tones, glyph=, vglyph=, tagglyph=, swatch=, track=, tint= — must be 1–24 lowercase letters, digits or -. Anything else is ignored.
  • Unknown directives are ignored, so a node meant for a newer CustomHUD never breaks an older one.
  • customhud.panorama keeps working on a server that renamed the renderer with RendererId.
  • Without a raw node, a row's text still splits on tabs: "AK-47\t500 XP\t7" is the label, a right-hand value and an icon badge.

Rows

Directive Effect
text=<text> Text only CustomHUD shows, at the node's place in the row. text=\t7 puts 7 in the value column
icon=<N> A rarity dot or tile tint, 1–10
image=<key> A picture — Image keys
tint=<token> With image=: a colour wash for art the game colours itself, such as graffiti
type=<label> A small caption over the name, such as Rifle
bar=<N> A share, 0–100, as a meter
chosen The player's own pick, such as their vote
danger A red row
disabled A dimmed row
marquee A scrolling label

Placement

Directive Effect
at=<region> Place the entry in a region of the page layout: banner (5 slots), detail (28), detailbar (3), foot (4), aside (8), strip (10). Absent, unknown or full: the main list
chip[=<tone>] A chip beside the title, up to 3. The text's first part is the value, the part after a tab its caption
head Not drawn: its tab-separated text becomes the column heads, up to 6
section A heading across the page that starts a new line of cards. Text after a tab shows beside it
group=<token> Adds grp-<token>. On a section, every entry up to the next section carries it
view=<token> Draw the page as that view. The first entry with one wins, and PageViews wins over it
inline Join the entry before it as a second button on its slot, such as Sell beside an owned item
fold No slot on a mouse page, because another entry shows what it says. Keyboard pages still draw it

The lists have one region, foot, with 3 slots.

Content

Directive Effect
sub=, unit=, tag=, tag2=, note=, mark= More text: a line under the name, a small word after it, two pills, a note at the right, and the text in the mark square
badge= A small boxed label under the name
glyph=<icon> An icon from customhud_icons.vcss, ico-<icon>
vglyph=<icon> The value's own icon, such as a price's coin
tagglyph=<icon> An icon inside the tag= pill
vunit=<text> A smaller unit after the value: 45 then %
swatch=<colour> A colour dot: red, blue, green, yellow, purple, orange, pink, cyan, white, black, team or random
avatar[=<text>] The mark square with the name's initial, in a colour fixed per name, or the given text
rating=<N> A CS Rating badge in its band's colour
pips=<K>/<N> N pips, up to 20, K of them lit
nays=<M> With pips=, M more lit after them, in red
bar2=<N> A second meter, 0–100
lead The leading entry: a gold Leading tag, unless it has a tag of its own
map Read the label as a map name, for its art
hint On a header entry: its text replaces a mouse player's footer hint
live=<menu id> On a header entry: the sidebar entry opening that menu gets a red dot

Tones

Directive Tones
tone= good, bad, gold, info, faint, main, ct, t. warn on a chip
subtone= good, bad, gold, info, faint
badgetone= good, bad, gold, info, accent
tagtone=, tag2tone= good, bad, gold, info, accent, ct, t, dark, legend
notetone= good, bad, gold, info, faint, accent
metertone= good, bad, gold, accent

Views add tone= values of their own: rank tiers r1–r7, Premier bands csr0–csr6 and levels l1, l2, l4, l8, l10, and MapChooser's extend, aim, awp, surf and ready.

Behaviour

Directive Effect
verb=<word> The legend's word for the entry: select, pick, open, switch, edit, change, vote or apply
primary The page's main action, in views that draw one
info A fact, not an action: no key and nothing to click. Added for you on a component whose selection does nothing
submenu A › at the right. Added for you on a SubmenuComponent
divider No row; a rule in the sidebar. Added for you on a DividerComponent
kind=<kind> What the row is: input, toggle, slider, choice, selector or progress. Added for you on SwiftlyS2's components
on=1, pct=<N>, num=<text> With kind=: a toggle that is on, a slider's position 0–100, and its value as shown

Card pages

In a layout with a Card profile — the WeaponSkins locker — a page whose first row carries hero draws as an inspect card.

Directive Effect
hero On the first body row: the row is the card's name, type= its rarity line, image= its picture
inline On a later row: join the field above as its slider bar, switch or clear button
track=<preset> On an inline slider: adds track-<preset>. wear bands it with the five exteriors

Image keys

Key Picture
A CS2 econ path, such as default_generated/weapon_ak47_cu_ak47_asiimov_light That item's art
map/<map> A stock map's screenshot, such as map/de_mirage
rank/skillgroup<N> The Competitive emblem, 0–18, or an icon 26283401–26283500 from Ranks' example icon addon
rank/wingman<N> The Wingman emblem, 0–18
rank/level<N> A level badge, 1–10

Pictures draw in the lists, the page layout and the WeaponSkins locker; the classic layouts have no picture slot. Sticker art draws only in WeaponSkins' two layouts, and map/ and rank/ keys not in the WeaponSkins locker.


What CustomHUD changes in a menu

Element Change
Title Rules such as --- and ───, and a trailing colon, are dropped
Dividers A body divider takes no row; only a sidebar draws one
Footer Replaced by the mode's key legend or hint
Pages Fixed pages instead of SwiftlyS2's scrolling window
Values A toggle, input, slider or choice puts its value in the value column
Accepted input The new value shows at once, in place of SwiftlyS2's two-second Accepted
Progress bars A meter, with the share in the value column, instead of block characters
Text width Not cut to MaxWidth: the layout ends it with an ellipsis at the row's edge, or scrolls it

Clone this wiki locally