CalmUI
CalmUI Studio

Mock Actions in Preview

See tooltips and dialogs that only a connected game would normally open, without starting PIE.

Studio Preview runs the shared C++ Core/PaintFrame path with no game attached. A button's ui:action still dispatches and still appears in the Actions output channel, but nothing answers it: a tooltip or dialog whose content only Blueprint provides stays empty or closed. Action mocks answer specific actions locally, the same way Store mock values already stand in for host data.

Action mocks are never used once Studio is connected to Unreal (Studio / Unreal set to Unreal): Preview then shows the real host response, and any matching mock is ignored.

Create mocks/actions.json

Add mocks/actions.json next to your existing mocks/store.*.json presets. Studio picks it up the moment the file exists; there is nothing to register in calmui.config.json. It is a JSON object keyed by action name (Group.Name, matching Store → Action Contracts):

mocks/actions.json
{
  "MainMenu.NewGame": {
    "patch": {
      "mainMenu.hasSave": true,
      "mainMenu.lastSaveId": "preview-save-1",
      "mainMenu.lastSaveName": "Preview Island",
      "mainMenu.pending": false
    },
    "delayMs": 200
  },
  "MainMenu.OpenSettings": {
    "tooltip": {
      "text": "Settings would open on the connected host.",
      "anchor": "#settings-button"
    }
  }
}

Each entry supports:

FieldWhat it does
patchStore paths and values, applied through the same mock-field path the Store panel already uses. ui:if/ui:show guards and computed values driven by those paths update the same way a real host patch would.
tooltiptext and an anchor (a data-testid value, or #elementId). Shown as a Studio-drawn overlay next to that node. Use this only when the project has no Store-driven tooltip screen of its own for the action; when it does, drive that screen's own Store fields from patch instead.
delayMsMilliseconds to wait after the action is dispatched before applying patch/showing tooltip. Defaults to 0.
Preview showing the Continue button with a Studio-drawn MOCKED TOOLTIP overlay reading Continue would resume Outpost Meridian on the connected host
A mock's tooltip is drawn by Studio next to the anchor element.

A tooltip entry renders as a Studio-drawn overlay next to the element its anchor points at, labeled MOCKED TOOLTIP so it is never mistaken for real game UI. It disappears the same way a real tooltip would, and only appears in Studio Preview; Unreal never sees it.

schemas/action-mocks.schema.json documents the exact shape. Editors that understand $schema can point at it for inline validation.

The shipped sandbox project has a working example at samples/CalmUiSandbox/CalmUI/mocks/actions.json.

What you see in Preview

  • Dispatching a mocked action applies its patch and/or shows its tooltip after delayMs. The Studio tooltip overlay mirrors to whichever side and edge of the canvas has room, and clears itself a few seconds later.
  • The Actions output channel marks a matched entry with a MOCKED chip.
  • An action with no matching entry is a no-op: Preview logs a line to the Studio output channel and moves on, the same as a real host that has not wired that action yet.
The Output panel's Channel selector set to Actions
Choose the Actions channel in the Output panel.

Open the Output panel and set its channel selector to Actions to watch dispatches as they happen.

Output panel, Actions channel, listing #1 Showcase.New null and #2 Showcase.Continue null with a MOCKED chip
The Actions channel marks an action answered by mocks/actions.json with a MOCKED chip.

Each entry lists the dispatch number, the action's Group.Name, and its payload. The MOCKED chip confirms that mocks/actions.json answered that specific dispatch; an entry without the chip either has no matching mock or is running against a connected Unreal session instead.

If a mock does not apply

  • Confirm the key is the action's full Group.Name, exactly as it appears in Store → Action Contracts and in the Actions output channel.
  • Confirm patch paths match Store field paths (state.field), not the action's own payload fields: a mock answers the action, it does not read its payload.
  • A malformed mocks/actions.json reports a parse error to the Studio output channel instead of applying any mock.
  • Switching Studio / Unreal to Unreal disables action mocks entirely; switch back to Studio to use them again.

See Handle a Button Action for the Blueprint side these mocks stand in for, and Preview a View or Component for Store mock values, which action mocks build on.

On this page