UGantrySettingsPage
A page of player settings, authored as an asset.
A page has a title, a sort order and its settings, in the order the page shows them. Create one in the Content Browser as a data asset of class Gantry Settings Page. Add each setting to the Settings list, pick its shape (Number Setting, Toggle Setting, or your own subclass), and fill it in place. Every setting needs an Id, unique among all of a player's settings. Each player gets their own copies of the settings.
A page reaches a player's registry in one of two ways:
- Listed in
Project Settings > Plugins > Gantry Settings: every player always has it. - Listed on an experience's Add Settings Pages stage: players have it while that experience is active. This is how a game mode or a DLC pack brings settings of its own.
A settings provider can also build pages in code, with New Page and Add Setting. Such a page belongs to one player from the start.
- Inherits
UPrimaryDataAsset
Properties
| Property | Type | Default | Description |
|---|---|---|---|
Title read-only | FText | The page's name, for its tab. | |
Description read-only | FText | One line on what the page holds, for the settings screen to show. | |
SortOrder read-only | int32 | 0 | Where the page goes among the others: lower comes first, and equal orders sort by Title. |
Settings read-only | TArray<TObjectPtr<UGantrySetting> > | The settings on the page, in the order shown. Each needs an Id unique among all of a player's settings. |
Functions
AddSetting
Adds a setting to a page a settings provider is building in code.
| Pin | Type | Direction | Description |
|---|---|---|---|
SettingClass | TSubclassOf<UGantrySetting> | in | The setting's class: one of Gantry's shapes, or the game's own. |
Id | FName | in | Its id, unique among all of a player's settings. |
DisplayName | FText | in | What the player reads. |
| Return Value | UGantrySetting* | out | The new setting, at the end of the page, for you to configure further; null for an abstract class. |
C++
Public C++ members that Blueprint does not see.
GetPrimaryAssetId
virtual FPrimaryAssetId
Primary asset type GantrySettingsPage, named after the asset.
IsDataValid
virtual EDataValidationResult
Checks every setting has an Id, and that no Id repeats on this page.
Tools > Gantry > Validate Experiences checks Ids across pages.