# Extend Rolly Settings in C++

> Add the plugin's modules to your code, find the extension points, replace subsystems and storage, and run the plugin's automated tests.

Product: Rolly Settings 1.2.0 | Sheet: guide | Updated: 2026-10-01 | HTML: https://rolly-docs.pages.dev/settings/guides/extending-in-cpp/

## Add the modules

| Module | Loads in | What it holds |
|---|---|---|
| `RollySettings` | Games, servers and the editor | The settings model and flows, the subsystems and their Blueprint API, the bindings, saving, the built-in library, the controls |
| `RollySettingsUI` | Games and the editor, never a dedicated server | The settings screen with its rows, dialogs and key capture, and the Open and Close Settings API |
| `RollySettingsEditor` | The editor | Asset tools, the checks on save, the cook hook, the Play In Editor restore and the automated tests |
| `RollySettingsCore` | Games, servers and the editor | The shared foundation: setup reports, validation, and the input device tracker behind the button prompts |
| `RollySettingsCoreUI` | Games and the editor, never a dedicated server | The Rolly UI design system: the theme and its presets, the widgets every Rolly screen is made of, the five layout templates, the per-player screen stack, dialogs and toasts |
| `RollySettingsCoreEditor` | The editor | The Message Log listing, the design system's cook hook and theme editor, its test support and its tests |

The last three are the shared Rolly foundation, carried inside this plugin under this product's name, so several Rolly products in one project never clash.

```csharp
PrivateDependencyModuleNames.AddRange(new string[]
{
	"RollySettings",   // values, flows, controls
	"RollySettingsUI", // the settings screen
	"RollySettingsCoreUI",     // themes, Rolly widgets, the screen stack
});
```

Headers sit in feature folders and are included by path from the module's `Public` folder (`Screens/RollySettingsScreen.h`); [ARCHITECTURE.md](https://rolly-docs.pages.dev/settings/architecture/) lists the folders and what each holds, the path of a value from the collection to the engine and the screen, and where the tests live. The [class reference](https://rolly-docs.pages.dev/settings/reference/classes/) gives every class's header.

## Extension points

- **A new binding target:** a subclass of `URollySettingBinding` (see [Add your own settings](https://rolly-docs.pages.dev/settings/guides/adding-settings/#make-a-value-do-something-in-your-game)), or a Blueprint child class of **Rolly Setting Custom Binding**.
- **A setting kind of your own:** a subclass of `URollySetting` with a row of your own (see [Change the settings screen's look](https://rolly-docs.pages.dev/settings/guides/screen-look/#replace-the-rows)).
- **Another save system:** a subclass of `URollySettingsStorage`, picked in Project Settings (see [Save settings and cook their assets](https://rolly-docs.pages.dev/settings/guides/saving-and-cooking/#use-your-own-save-system)).
- **Subsystems:** a project subclass of `URollySettingsSubsystem`, `URollySettingsSharedSubsystem`, `URollySettingsUISubsystem`, `URollySettingsCoreUIStackSubsystem` or `URollySettingsCoreUISharedSubsystem` replaces the plugin's own.
- **Hosting and input:** `IRollySettingsCoreUIPresenter` and `IRollySettingsCoreUIInputHandler` (see [Host screens in Common UI or your own layers](https://rolly-docs.pages.dev/settings/guides/hosting-screens/)).
- **Screens and widgets:** `URollySettingsCoreUIScreen`, `URollySettingsCoreUIDialog`, `URollySettingsCoreUIUserWidget` with `ApplyStyle` (see [Open screens on the screen stack](https://rolly-docs.pages.dev/settings/guides/screen-stack/) and [Make a theme of your own](https://rolly-docs.pages.dev/settings/guides/themes/#make-your-own-widgets-follow-the-theme)).

C++ code can also use the plain classes directly:

- `FRollySettingsModel`: values and flows of one scope;
- `FRollySettingsPlayerView`: one player's view of both scopes;
- `FRollySettingsValidator`: the checks on save;
- `FRollySettingsDefaultLibrary::Create`: the built-in library as a new collection;
- `FRollySettingsControls` (`URollySettingsSubsystem::GetControls`): one player's key rows, checks, rebinds and resets;
- `URollySettingsCoreInputDeviceSubsystem` (`URollySettingsSubsystem::GetInputDevices`): the input method and gamepad family, with a native change event.

## Run the automated tests

The tests are `Rolly.Settings.*` (the settings screen: `Rolly.Settings.UI.*`) and `RollySettingsCore.*` for the shared foundation and the design system (`RollySettingsCore.UI.*`). Run them in the editor from Tools > Session Frontend > Automation (filter `Rolly`), or headless:

```text
UnrealEditor-Cmd.exe <YourProject>.uproject -ExecCmds="Automation RunTests Rolly; Quit" -unattended -nullrhi
```

- They build their collections in code, use test tags under `Rolly.Settings.Test`, run two local players without Play In Editor, write files only under `Saved/Automation/Tmp` (and a test key file, below), and restore Project Settings and the theme afterwards.
- Tests that apply built-in bindings record the engine values first and put them back at the end (`FRollySettingsScopedEngineState`, which includes the language and the asset group cultures), and they never save GameUserSettings.ini. Headless runs have no display, audio device or HDR, so they check the values the bindings hand to the engine; how a mode, a volume or a colour correction looks is checked in a packaged build. The audio tests record what the audio subsystem would send to the device and use a fake device list; the language tests use fake cultures and write the translation files they need, which they delete.
- The controls tests build their input actions and mapping contexts in code, give each player a controller, and save keys only to the test slot `RollySettingsAutomationKeys` (and `_1` to `_3`) in `Saved/SaveGames`, which they delete before and after. The device tests use a fake device lookup and, for one simulated pad, the engine's simulated device descriptors (development builds only), and never register a real device.
- The screen tests show each player's screen host in a virtual window and press keys through a virtual Slate user, as a player would; they never open a window or touch the editor's own focus.
- The screenshot tests render PNG pictures when the run can render (`-RenderOffScreen` instead of `-nullrhi`), into the report folder's `Screenshots` folder; a `-nullrhi` run skips the pictures. `Rolly.Settings.UI.Screenshots.Screens` renders the settings screen (every tab, a pad's prompts, high contrast, split screen), its dialogs and key capture; `.Templates` every layout at 1920 x 1080, 1280 x 800, 2560 x 1080 and 3840 x 1080 and in a 2- and 4-player split; `.Presets` every theme preset with its contrast measured in the picture; `.AudioLanguage` the Audio and Language pages in every layout, the language question and the globe icon in every preset; `.Matrix` every layout at nine reference sizes from 640 x 360 to 3840 x 1080, checking in every run that Back and Apply show inside the area, that exactly one thing shows focus and shows whole, and that the header, navigation, list, detail and footer stay apart and inside the area. `RollySettingsCore.UI.Screenshots.StateSheet` renders every row and button state with a greyscale copy.
- Key caps must sit level with their words, row names with their values, and dialog buttons must centre their labels: `Rolly.Settings.UI.Look.Alignment` checks this from the layout in every run, and the screenshot run checks the prompts and tab keys again in the rendered pictures.
