Accessibility
Every player gets an Accessibility tab in the player settings, so any settings menu that shows the registry (the settings screen of Pulse Core, for example) shows it without setup. Pulse Foundation applies the display options itself; plugins and games ask for the rest.
| Section | Setting | What it does |
|---|---|---|
| Vision | Color vision | Corrects the screen for deuteranopia (green), protanopia (red) or tritanopia (blue) |
| Vision | Strength | How strong the deficiency is (1 to 10) |
| Vision | Correct colors | On: the colors are corrected. Off: the screen shows how the deficiency looks (to test your game) |
| Display | Text size | Factor for every text that takes its style from a text role of the UI theme |
| Display | Interface size | Factor for the whole game UI |
| Display | Reduce motion | UI motions jump to their end; Pulse Camera plays no camera shakes |
| Controls | Toggle instead of hold | Actions that need a key held start with a press and run on their own; a second press cancels them |
| Controls | Toggle: action | The same for one action, e.g. Toggle: Interact of Pulse Core (shows while the switch above is off) |
The settings live in UPulseAccessibilitySettings (ids Pulse.Setting.Accessibility.*). A game with accessibility options of its own turns the tab off with Register Accessibility Settings (Project Settings > Pulse > Foundation).
How the display options apply
UPulseAccessibilitySubsystem (module PulseFoundationUI, one per local player) applies them at start and whenever they change:
- Text size goes to the theme subsystem of the player (Set Text Scale). Text roles applied by the Pulse Style component or
UPulseUIStyleComponent::ApplyRoleToWidgetget the font size of their style times the factor, rounded to whole points; widgets update like on a theme change. Texts with a fixed font are not scaled. - Interface size multiplies the Application Scale of the project (Project Settings > User Interface); the game viewport reads it every frame. The first local player decides, and the project value comes back when it leaves.
- Color vision goes to the Slate renderer, which corrects every window of the game. In the editor (PIE) it also colors the editor windows while the session runs.
- Reduce motion is asked by
Pulse::UI::PlayMotionand the stack transitions of the theme, together with the project switch Reduce Motion of the UI settings.
Toggle instead of hold
Ask before you make a key a hold: Should Toggle Hold (UPulseAccessibilityLibrary, any object of the player) returns true when the player toggles all hold actions or this action. With true, start on the press, ignore the release while the action runs, and cancel on the next press. Only the machine of the player decides; the server follows what the player’s machine sends. Pulse Core does this for interactions with a hold time.
Give an action of your game its own switch in the Controls section with Register Hold Action (setting id, name) before the players exist, e.g. in the Init of the game instance; plugins call Pulse::Accessibility::RegisterHoldAction in StartupModule:
// StartupModule of a plugin
Pulse::Accessibility::RegisterHoldAction(TAG_ToggleHold_Revive, LOCTEXT("Revive", "Revive"));
// Where the action reads its key
if (Pulse::Accessibility::ShouldToggleHold(LocalPlayer, TAG_ToggleHold_Revive))
...
The toggle settings of single actions have no object behind them: the registry keeps their value (source Stored Value, see Player settings).
Blueprint and C++
| Function | What it returns |
|---|---|
| Should Toggle Hold (Player, Action) | Whether a hold action toggles for the player |
| Should Reduce Motion (Player) | Whether the player wants less motion |
| Register Hold Action (Action, Display Name) | Adds the toggle setting of an action |
Pulse::Accessibility::GetSettings(LocalPlayer) | The accessibility settings of a player (the defaults without one) |
Pulse::Accessibility::FindLocalPlayer(Object) | The local player of a controller, pawn, player state, component or widget |
Pulse::UI::GetTextScale(Widget), Pulse::UI::ShouldReduceMotion(Widget) | The text size and the motion switch of a widget’s player |