Rolly Docs

Change the settings screen's look

Pick the settings screen's layout and theme, let players choose a theme and turn on high contrast, and replace its layout, rows and pieces with Widget Blueprints of your own.

Sheet
05 of 45
Rev
1.2.0
Updated
On this sheet

Pick a layout and a theme

The settings screen lays itself out in one of five layouts (Tabs, Side Rail, Centered Panel, Couch Hub, Side Drawer) and draws with a theme. Both are shared with every Rolly screen:

  • Project Settings > Plugins > Rolly Settings Core UI > Layout picks the layout; see Choose a layout for what each one shows and how to switch while the game runs.
  • A Rolly Settings Core UI Theme asset gives the look; start from one of six presets and edit it with a live preview of the settings screen (see Make a theme of your own).
Figure 1. The settings screen with High Contrast Interface on.

Let players pick high contrast and reduced motion

The built-in High Contrast Interface and Reduce Motion settings (Accessibility category) drive every Rolly screen: high contrast draws the theme’s High Contrast Colours with outlined panels and a 3-unit focus ring; reduced motion stops movement and keeps fades at 100 ms or less. They set the shared console variables rolly.ui.contrast and rolly.ui.motion, so the screens of every installed Rolly product follow them (see Share one look across Rolly products). In a collection of your own, add Toggles with the High Contrast Interface and Reduce Motion bindings.

Let players pick the theme

Rolly Settings has no built-in theme setting, because the themes a game offers are its own. Add one to your collection:

  1. Add a Choice named Interface Theme, with the Console Variable binding, Variable Name rolly.ui.theme and Default Value Default.
  2. Give it options whose ids are what to show: Default (named, for example, Game Default; it removes the player’s choice, so the shared theme applies again), presets as Preset:Paper or Preset:HighContrast, and your theme assets as their paths (/Game/UI/RT_Cozy.RT_Cozy).

Choosing one restyles every Rolly product at once, and the choice is saved with the other settings. Every theme you offer must be cooked: share one of them, or reference the others from your own content.

Replace the screen’s layout

Every screen and piece is an ordinary user widget whose default layout is built in C++; a Widget Blueprint subclass with a layout of its own keeps it, and the parts it leaves out only turn their feature off (see Choose a layout). The class reference lists the parts of every class, with the widget each one needs.

What (parent class) Where you pick your subclass
The settings screen (Rolly Settings Screen) Project Settings > Plugins > Rolly Settings Screen > Settings Screen Class. Without a layout of your own the screen puts its parts into the layout template in use; with one, your layout decides
Key capture (Rolly Settings Key Capture Screen) The same page: Key Capture Screen Class
A layout template (Rolly Tabs Template and the others) Project Settings > Plugins > Rolly Settings Core UI > Template Classes (see Choose a layout)
Dialogs (the keep-or-revert, discard, reset and key swap questions), toasts, tabs, prompts, rail items and tiles See Choose a layout; tabs, prompts, rail items and tiles are class defaults of your settings screen subclass (category Parts)

The screen’s other class defaults are its keys (category Keys) and Ask Before Discarding. All of this works in Blueprint, without C++.

Replace the rows

Row Classes maps a setting kind to a row: Project Settings > Plugins > Rolly Settings Screen for every screen, or the class defaults of your settings screen subclass (category Rows), whose entries win for the same kind. A setting shows with the row of its own class, else of its nearest parent class: a subclass of a built-in kind keeps the built-in row until you list one. A row derives from Rolly Settings Setting Row; the Key Mappings entry names the rows of the key list, which derive from Rolly Settings Row. A row that cannot show its kind is reported and the next one is used; a setting of a kind the screen has no row for (a C++ setting class of your own) is reported and left out of the screen.

Blueprint

Make a Widget Blueprint whose parent class is the built-in row you replace (Rolly Settings Toggle Row, Choice Row, Slider Row, Action Row, Key Binding Row, or Rolly Settings Key Mapping Row for the key list), give it a layout of its own (see Replace a piece with a layout of your own), and list it in Row Classes for that kind.

C++

A setting kind of your own (a C++ subclass of Rolly Setting or of a built-in kind) shows with a row of your own once Row Classes names it, with no change to the plugin:

// A kind (in your runtime module): a line of text the player types elsewhere.
UCLASS(meta = (DisplayName = "Note"))
class UMyNoteSetting : public URollySetting
{
	GENERATED_BODY()
public:
	virtual bool NormalizeValue(const FString& InValue, TConstArrayView<FRollySettingOption> Options, FString& OutValue) const override { OutValue = InValue; return true; }
	virtual FText GetDisplayText(const FString& Value, TConstArrayView<FRollySettingOption> Options) const override { return FText::FromString(Value); }
	virtual FText GetKindName() const override { return NSLOCTEXT("MyGame", "NoteKind", "Note"); }
};

// Its row (in your UI module): BuildValueWidget makes the value's part, RefreshValue shows GetValueText().
UCLASS()
class UMyNoteRow : public URollySettingsSettingRow
{
	GENERATED_BODY()
};

// Then in Project Settings > Plugins > Rolly Settings Screen > Row Classes: My Note Setting -> My Note Row.
C++

The classes to start from: URollySettingsCoreUIScreen (screens), URollySettingsCoreUIDialog (dialog layouts), URollySettingsSettingRow and the rows of each kind (rows of the settings screen; URollySettingsRow for the key list’s rows), URollySettingsCoreUIUserWidget (any widget that follows the theme). Their headers document every function.