Repository navigation
Layout Variations
A variation is a copy of a shipped layout in a look of your own: the same panels, your own stylesheet. You build it into a Workshop addon of your own, serve that addon beside CustomHUD's, and pick it by name in config.jsonc (in addons/swiftlys2/configs/plugins/CustomHUD/).
- A variation keeps every panel id of the layout it copies, because CustomHUD writes to those ids. Change styles, never panels.
- Players need both addons. A menu set to your variation draws nothing for a player without yours.
- A CustomHUD update can change a shipped layout. When it changes the one you copied, copy it again and keep your stylesheet.
Take the layout from the CustomHUD repository's resources/panorama folder:
| What | Path |
|---|---|
| The layout |
layout/custom_game/customhud/<layout>.vxml, such as menu_list_v2.vxml for the keyboard list |
| Its stylesheets, to read |
styles/custom_game/customhud/: the layout's own <layout>.vcss, and the ones its <include> lines name |
Every shipped layout and what it draws: Layouts.
-
Rename the layout with a name of your own:
menu_list_myserver.vxml. Never reuse a shipped name. -
Add your stylesheet as its last
<include>, so your rules win:<include src="s2r://panorama/styles/custom_game/customhud/menu_list_v2.vcss_c" /> <include src="s2r://panorama/styles/custom_game/customhud/menu_list_myserver.vcss_c" />
-
Write
menu_list_myserver.vcsswith the rules you change, using the classes the shipped stylesheets use:.ls2-band { background-color: #7a1f1f; }
The band over a menu's title turns red; everything else keeps the shipped look. Panorama is not web CSS: the stylesheet rules list what CS2 draws and what it silently drops, and F6 in game opens the Panorama debugger on any panel.
CS2 loads only compiled _c files. Create an addon in CS2 Workshop Tools, such as myserver_hud, then:
| Step | Do |
|---|---|
| Sources | Put the layout in <CS2>\content\csgo_addons\myserver_hud\panorama\layout\custom_game\customhud\ and the stylesheet in ...\panorama\styles\custom_game\customhud\
|
| Compile | Run <CS2>\game\bin\win64\resourcecompiler.exe -f -i <file> for the stylesheet, then for the layout |
| Output | The _c files land in <CS2>\game\csgo_addons\myserver_hud\panorama\
|
<CS2> is CS2's folder: C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive. CS2 refuses a layout outside panorama/layout/custom_game/.
- Publish the addon from Workshop Tools and note its Workshop id.
- Add the id to
Main.Addonsin AddonsManager'sconfig.jsonc, beside CustomHUD's"3834965450". - Restart the server, so players download both.
Every other plugin's keyboard menus draw in your copy, each with the rows, names and art menu_list_v2 would give them. Set a plugin's own entry in Menus for its menus.
-
Basenames the shipped layout you copied. Your copy then serves the same players and plugins it does: a copy ofmenu_locker_v2draws each supported plugin's pages in its own way. - With
Base, the entry's other fields are ignored. One without aFileis logged at start.
A message or panel layout is small, so its entry names its parts itself:
{
"CustomHUD": {
"MessageLayouts": {
"hud_text_myserver": {
"File": "hud_text_myserver.vxml_c"
}
},
"Messages": {
"Center": "hud_text_myserver"
}
}
}Centre messages draw in your copy of hud_text. A MessageLayouts entry starts from hud_text's panel names and 5 seconds. A PanelLayouts entry also lists the panel's variables as BlankVariables: Shipped panels names them.
| Check | Expect |
|---|---|
| Console at start | No [CustomHUD] config.jsonc: line about your entry |
| A menu set to your variation | Your look, with every row, value and key in place |
| A menu on a shipped layout | Unchanged |
Text such as {s:option_3_note} on screen |
Your copy comes from another CustomHUD version than the server runs: copy it again |
{ "CustomHUD": { "MenuLayouts": { "menu_list_myserver": { "Base": "menu_list_v2", "File": "menu_list_myserver.vxml_c" } }, "Menus": { "Other": { "Keyboard": "menu_list_myserver" } } } }