UI
The core module has no UI dependency. PulseBuildMVVM has the view models, PulseBuildUI the default CommonUI widgets in the PulseFoundation UI theme.
View models
UMVVMPulseBuilder describes the player’s builder for menus and overlays. It finds the build component also when the pawn comes later, refreshes on the component’s events, and on a 0.25 s timer only while a tool is active or SetLiveUpdates(true) is set (open menus).
| Field | Content |
|---|---|
| Tool, selected piece, placement result and reason | What the player does right now |
Pieces, categories (FPulseBuildCategoryView), search text, category filter | The menu list |
| Hotbar, favorites, recent pieces | One UMVVMPulseBuildPiece per entry |
| Build points, cost lines, target piece and its upgrade/repair/refund lines | Overlay info |
UMVVMPulseBuildPiece has name, description, icon, category, cost lines, affordability, favorite, hotbar slot and lock (IsLocked, GetLockReason). Actions: SelectPiece, SetTool, SetSearchText, SetCategory, ToggleFavorite, SetHotbarSlot, SelectHotbarSlot, Refresh.
Use the shared instance of the local player: UPulseBuildUISubsystem::GetBuilderViewModel().
Locked pieces
A piece a Lock Piece adjustment of the tuning locks (see Locked pieces) stays in the piece list, the hotbar and the favorites. Its entry has bLocked (IsLocked) and LockReason (GetLockReason: the text of the lock, else “This piece is locked.”, empty while not locked), both field notify, so a widget can grey the piece out and show why. Every entry reads them on each refresh, also hotbar and favorite entries that skip the costs. UMVVMPulseBuilder listens to the tuning of the player’s world (UPulseTuningSubsystem::OnTuningChangedNative) and reads the locks of all entries again when the adjustments or the difficulty change, then fires OnChanged; selecting a locked piece is refused by the build component (Pulse.Result.Failure.Build.Locked). The default piece entry (UPulseBuildPieceEntry) dims locked pieces to LockedOpacity (0.3; pieces that cannot be paid: UnaffordableOpacity, 0.5), see Pulse::Build::UI::GetPieceEntryOpacity.
Default widgets
| Widget | Content |
|---|---|
W_PulseBuildMenu | Categories as tabs, search, piece tiles with costs and affordability, details, favorite and hotbar buttons. Closes on Escape, gamepad B or Tab. |
W_PulseBuildRadialMenu | Hotbar or favorites around the crosshair |
W_PulseBuildOverlay | While building: info panel (piece, costs, target piece), key hints (FPulseBuildKeyHint), build hotbar |
They live in /PulseBuild/UI and are built from C++ base classes (UPulseBuildMenuWidget, UPulseBuildRadialMenuWidget, UPulseBuildOverlayWidget, UPulseBuildInfoWidget, UPulseBuildHintsWidget, UPulseBuildHotbarWidget, entries and buttons) with optional bindings, so your own layouts can reuse the logic. Their look comes from the theme roles (Pulse.UI.*).
Opening the widgets
UPulseBuildUISubsystem (local player): ShowOverlay, HideOverlay, OpenMenu, OpenRadialMenu, CloseMenus. Which classes it opens is set in Project Settings > Pulse > Build > UI (MenuClass, RadialMenuClass, OverlayClass).
Where they appear is decided by the UI host of PulseFoundation (UPulseUIPresenter; the Pulse HUD when PulseGameplay is enabled, else the viewport):
- the build menu and the radial menu open on a layer (
MenuLayer,RadialMenuLayer, bothPulse.UI.Layer.Menu): the menu layer shows the cursor and takes the input while they are open; CloseMenuscloses only the building menus, also one the other covers (it does not come back); other widgets on the same layer (a settings menu) stay open;- the overlay goes into the gameplay part of the host (
OverlayPlacement: the whole area, 84 free at the bottom for the item hotbar), so it hides with the HUD; after a map change or with a new host it comes back untilHideOverlay.
A game with its own HUD sets its own presenter in Project Settings > Pulse > Foundation > UI; Pulse Build needs no change for it.
Cheats: PulseBuildOverlay, PulseBuildMenu, PulseBuildRadial, PulseBuildCloseMenus.