Rolly Docs

Host screens in Common UI or your own layers

Use the Rolly screens in a Common UI game with its key icons, put each player's screens into a layer of your own interface, and hand the game's input to your own input policy.

Sheet
10 of 45
Rev
1.2.0
Updated
On this sheet

In a Common UI game

Nothing to set up. When the game viewport client is Common UI’s (Project Settings > Engine > General Settings > Game Viewport Client Class is CommonGameViewportClient or a subclass), each player’s Rolly screens open inside an activatable widget of their own on the viewport, so Common UI’s router keeps focus on them, and:

  • Accept on a row acts on the row (a slider steps once, a choice moves one option), never a click at its centre;
  • Rolly’s prompts stay on the player’s device: the analog cursor’s moves never switch them to the mouse;
  • Back goes up Rolly’s levels, then closes the screens;
  • while the screens are open Common UI’s input config for their activatable widget holds the game’s input (Menu, a free mouse); the game’s input as the first screen opened is recorded, as without Common UI, and when the last screen closes it comes back as Input After Screens asks: by default the mouse capture, the lock and the cursor the game had, and focus on the widget that had it, the game viewport taking the mouse again for mouse look. Common UI then gives an activatable widget of the game’s own its input config;
  • a toast during play leaves the activatable widget inactive: the game keeps its input, the mouse capture and the cursor, and a toast still showing when the last screen closes keeps nothing from the game’s menu.

Rolly’s prompt bar shows the prompts of every Rolly screen. Common UI’s action bar lists nothing while a Rolly screen is on top: hide it while it is empty.

Project Settings > Plugins > Rolly Settings Core UI > Common UI:

Setting What it does
Common UI Auto (the default) adapts when the game uses Common UI’s viewport client; Off leaves the screens as they are.
Common UI Host Class The activatable widget the screens open in: a Widget Blueprint subclass of Common Activatable Widget, to set its input config. Leave its Get Desired Focus Target empty: the Rolly screens take focus themselves. Empty: Common Activatable Widget.
Common UI Host Panel The panel of that class (an Overlay, by name) the screens go into. Empty: they fill it.

Into your layer stack

To put the screens into one of your own activatable widget stacks (a Menu layer of your root layout), call Push Rolly Screens Into Common UI Stack with the player controller and the stack before you open a Rolly screen: it pushes the host class into the stack and shows the player’s screens in its panel. The stack takes the widget off again when the last Rolly screen closes.

Your Common UI icons on key caps

Rolly’s key caps show the icon your Common UI controller data gives a key (Project Settings > Game > Common Input Settings > Controller Data): a theme’s Glyph Override first, then your Common UI icon for the key’s device, then the drawn cap. In the editor, controller data not loaded yet loads in the background and the caps change as it arrives; an edit of Common Input Settings or of a controller data shows without a restart.

Setting (Plugins > Rolly Settings Core UI > Common UI) What it does
Common UI Icons Auto (the default) shows them while Common UI is enabled; Off keeps the drawn caps.
Common UI Gamepad Names The controller data’s Gamepad Name whose icons each gamepad family shows. A cap of the pad in the player’s hands, while the player picked no family, shows the pad Common UI reports for that player, else the platform’s Default Gamepad Name. A cap of another family (prompts the player picked in Rolly Settings, a preview) shows the name given here, else stays drawn.

Show the screens in a panel of your HUD

For a panel you own (an Overlay of your HUD), Set Host Panel on the player’s stack is enough; see Open screens on the screen stack.

Show the screens in a layer system

A game with its own layer system puts each player’s host (the widget that holds the player’s screens) into one of its layers with a presenter: a small C++ class implementing IRollySettingsCoreUIPresenter (Present, Dismiss, IsPresented, and optionally GetAreaSize for the compact layouts: the room the host gets, less the title-safe insets its Safe Zone pads by, FRollySettingsCoreUISafeArea::ReduceArea), handed to each player’s stack with URollySettingsCoreUIStackSubsystem::SetPresenter. While Rolly screens are open the host keeps the player’s input from the game.

Replace the input handling

A game with an input policy of its own can replace how screens take and give back the game’s input: implement IRollySettingsCoreUIInputHandler and hand it to URollySettingsCoreUISharedSubsystem::SetInputHandler. The built-in handler records the viewport’s input flags and the cursor when the first screen opens and restores them after the last one closes (see Open screens on the screen stack). A handler that keeps a record past the last close (waiting for another product’s screens) says so in HoldsGameInput, which Are Rolly Screens Open answers the other products, so none of them records the game’s input meanwhile.

Limits

  • The screens do not use Common UI’s bound actions: their keys come from the engine’s navigation config and the screens’ own key lists.
  • Common UI’s names are read by name: a later engine version that renames one turns the adaptation off with a setup message, and the screens work as without Common UI. The same holds for the icons: a renamed field gives one setup message, and the caps are drawn.