UI Metadata - anticto/Mutable-Documentation GitHub Wiki

UI Metadata

All parameter nodes and states have a section in common, the UI section. In this section, users can specify extra information for each parameter and parameter option. This information is available in-game. UI metadata is commonly used to help generate the in-game UI.

image

  • Minimum & Maximum Values: This two numerical options can store scalar values.

  • Editor Gameplay Tags: This is an Editor Only variable, which means that it is no available in-game. It allows to add tags to parameters and parameter options. Then, from the Preview Instance tab, we can filter parameter options that contains any or all the specified tags.

  • Object Friendly & UI Section Names: These two options can store string values.

  • UI Order: This option can store an integer value.

  • UI Thumbnail: This option can store a UTexture2D

  • Editor UIThumbnail Object: This is also an Editor Only variable. It is used to set a thumbnail to a parameter option in the Instance Properties tab when *UI Thumbnails option is checked. This can be any type of asset that has a UE thumbnail.

  • Extra Information: This option is a Map that allows to add extra String information with a specifier.

    image

  • Extra Assets: This option is similar to the previous one but, it allows to add extra asset information with a specifier.

    image

UI Metadata API

The UI Metadata is stored inside the CO. Users can access it using the following methods:

  • GetParameterUIMetadata: This method returns the UI Metadata of the specified parameter.

  • GetIntParameterOptionUIMetadata: This method returns the UI Metadata of the specified parameter option.

  • GetStateUIMetadata: This method returns the UI Metadata of the specified state.

UI Metadata with Table Nodes

Parameters generated through a Table Node can have metadata too. This can be done by adding a new variable to the Data Table Structure of type Mutable Param UI Metadata. Then, from the Table Node Properties tab, we can specify which column of the Data Table will be used as UI Metadata for each parameter option.

Example of Usage

The perfect example to see how the UI Metadata works is the "Preview Instance" tab of the Customizable Object and Customizable Object Instance Editors.

In the editor, users can set the Maximum Value and Minimum Value options to determine the boundaries of the float parameters. In the following example, the value of the middle point changes depending on the Maximum and Minimum values.

Users can organize the parameters of the Preview Instance tab specify a UI Section for each parameter. After recompile the Customizable Object and checking the UI Sections option of the Preview Instance all the parameters will be organized in their corresponding sections. Parameters that do not have a section specified will go to a section called "Miscellaneous".

Another way to organize the parameter of the Preview Instance is setting a value to the UI Order option. This setting organizes parameters by this value from low to high.

As we have seen, if users specify a Texture to the UI Thumbnail option or an UAsset to the UI Thumbnail Editor option, each parameter option will have a thumbnail next to the option name.

If there is a value in both options, the thumbnail that is shown is the Texture2D set to the UI Thumbnail option.

Finally, the Editor UI also have an example of how to use the Extra Assets map. If users add a new map entrance to a float parameter with the Key "SliderImage" and a UTexture2D asset, the slider of the float parameter will set that texture as the widget's background.

image image