Published: July 15. 2023 by Last documented edit: Mar 24 2024 by
This guide tells you how to add a custom HUD icon for a weapon. It is a subsection of the ItemAdditions: Weapons guide, but since the same principle applies for all parts of the UI, it can be used standalone.
We need an .inkatlas file and a texture.
Download the correct template from the wiki's github repository. For a hudicon, that's weapons_hudicon.zip
Extract both files to a fitting subfolder in your Wolvenkit project.
Now we need to custompath those files:
Open your .inkatlas
file
Open the slots
array
Click on each slot and set the value to your texture's relative path
If you're cool with your slot's name being your_custom_hudicon
, you can change its name:
Expand the first slot (the one with the number 0)
Expand its list of parts
Select the first entry your_custom_hudicon
and change its name to whatever you want to use in the yaml
Export your .xbm (texture) via Wolvenkit, then edit the resulting .png in chosen your image editor of choice.
For more info on texture editing (and transparency!), check Textures: Importing, editing, exporting
For a (far) more detailed guide, check creating custom inventory icons
Once you are done, Import your PNG over the xbm with those settings:
Edit the inkatlas file as in the icon creation guide.
Now that you have a custom preview icon, it's time to hook it up. You do this by editing the .yaml file.
You'll find written instructions below the screenshot.
Add a HUDWeaponIcons
entry at the root level of your .yaml (no indent). Give it a name, such as HUDWeaponIcons.TheFallout
in the screenshot above.
It has the following properties (indent level 1):
Add a new property to the weapon that refers to the record you have created above:
That's it! After starting the game,
Key | Value | Explanation |
---|---|---|
$type
gamedataUIIcon_Record
This tells the game that it's a UI icon
atlasResourcePath
path/to/your/file.inkatlas
relative path to your inkatlas file (right-click it in Wolvenkit and select "Copy relative path")
atlasPartName
slot_02
name of the icon's slot in the inkatlas. If you don't know it, see here.
hudIcon
HUDWeaponIcons.TheFallout