Finding Elements - rbjaxter/budhud GitHub Wiki

Prerequisites

  • sv_cheats 1 enabled server
  • Alternatively, you can use this alias in any server: alias vt "incrementvar vgui_drawtree 0 1 1"
    • Then, just type vt in console and it'll open the drawtree

Information

vgui_drawtree is a very useful tool for hud developers to use to track down elements so you can modify them.

Note

You'll likely be able to find a majority of what you'd need by searching through these two links:

Knowing how to use drawtree is still very helpful, however.

Guide

Step 1

Open drawtree by typing vgui_drawtree 1 in console (requires sv_cheats 1 to be set, unless using the alias above)

Important

To see the full size of an image in this guide, right click on the image > Open image in new tab

01a - Console 01b - vgui_drawtree

Console key is ~ by default

Step 2

Check Highlight Selected and then go down the tree until you find the element you want to modify highlighted by the red box.

02 - Finding the element

It is worth noting that some elements can still be tricky to track down. For instance, TargetDataLabel is shown as being under CMainTargetID, but the file itself is in ..\resource\ui\targetid.res. Just be prepared to have to think outside of the box to find the exact element you're trying to edit.

TargetDataLabel Location Example

Step 3

Use Notepad++ (or similar program) to search your hud's directory for the element.

Note that this will only work if the directory you're searching contains all of the default hud's files

03 - Searching files for element

Step 4

Find the file listed in the search results and modify it as needed.

04 - Finding specific file

⚠️ **GitHub.com Fallback** ⚠️