The settings module comes in 2 parts: the Config Parser, and the Mod Settings UI kit. The Mod Settings UI kit includes a component called BP_MainMenuModSettings which is added to the HUD and adds the MODS settings menu in the game’s Main Menu.
For settings to be persisted to disk on the client or server, the BP_ConfigParser component includes the necessary RPCs for managing read and write. Add a Config Parser component to both your Game State override and your Player State override. If you don’t already have child blueprints created for both classes, you will need to create them.
To add a new page of settings to the Mod Settings menu, create a new Widget Blueprint and parent it to WBP_ModSettingsBase. Override the GetSettingsHierarchy interface function, and create Map and Array literals to sketch the menu hierarchy. The S_SettingsTree struct allows each child item within the submenu to have 1 or many children of its own. Multiple settings pages can be added to the tree using this function, if needed.
The settings widget blueprint you created in Step 3 can be configured to save its settings to a file on the Client or Server using the Persistence Type option. Sessional doesn’t save to a file, so settings changed only last until the game is closed. The Permissions Type option is used to determine who can access the settings page in the Main Menu. Using the Cameraman permission requires that the player have toggled admin cam on to see the settings. The Whitelist permission type checks the player’s Steam ID against the list provided in the SteamIDWhitelist option in the class defaults. Default Filename should be set to something unique even if Sessional persistence is used, and should be similar to the name of the settings page. Default Namespace can be changed if desired, otherwise leave default. The Backup option can be set to a data table asset for restoring backups if needed. It’s ok to leave this blank if you are defining settings controls manually, since the settings control defaults will be used in that case.
Continue building out the settings controls. It’s required to add a Vertical Box, and make it a variable. 3 control types are provided, WBP_SettingsItem_Slider, WBP_SettingsItem_TickBox, and WBP_SettingsItem_TextBox for different needs, along with a WBP_SettingsHeader. For each control used, make sure to set the Key variable to the name of the settings key it is for.
The standard way to access what values have been set is to use the BPFL_Config functions GetConfigParserComponent_Client (if client side) or GetConfigParserComponent_Server (if serverside). Multiple helper functions are provided in the Config Parser for retrieving settings values in different forms. There is also an OnSettingChanged event which triggers each time a setting is set, which can be used to update client code in realtime.