HomeSystem plugins › AFS_UI_Popups
System

AFS_UI_Popups

Modal popups anchored in pawn UI space, with configurable buttons, icon, title and body.

What it gives you

  • Modal confirmation and message dialogs
  • Any number of buttons with hierarchy styling
  • Correct spatial placement on every platform

Requires

AFA_Colors AFS_UI AFS_UISpace_Pawn

Required by

None

2 assets10 API members

Description

Popups are for decisions that must be made before continuing. BFL_Popups.Popup_ShowPopup_Default builds one from an icon, a title, body text and an array of button definitions, anchors it in pawn UI space and returns the widget so you can bind to the buttons.

Placement comes from a PDA_PawnUIPosition data asset, so a popup sits at a comfortable reading distance in VR and centred on screen on desktop, from the same call.

Setup

  1. Enable AFS_UI_Popups. It requires AFS_UISpace_Pawn and AFS_UI.
  2. Confirm the pawn has BPC_PawnAbility_PawnUI.
  3. Call the library function.

Usage

Showing a confirmation

Pass two entries in Button Contents and matching Button Presets to style one as primary and one as secondary. Bind to the returned widget's button delegates.

Blocking interaction behind the popup

Use setAbilityRestriction on the pawn to suppress interaction abilities while the popup is open, then release when it closes.

A modal popup with two buttons
AFS_UI_Popups_result.pngA modal popup with two buttons
A modal popup with two buttons

Key properties

PropertyWhen to change
Button Contents / Button PresetsThe buttons and their visual hierarchy
Position data assetWhere the popup sits relative to the player

Extending

Derive from WBP_Popup_Default for a different popup layout.

Example map

Map_Examples_Popups demonstrates several popup configurations.

Troubleshooting

The popup appears behind something. Its pawn UI position overlaps another element; give it a dedicated position data asset.

API reference

Every blueprint asset in this plugin. Expand an asset to see its members.

Libraries

BFL_Popups1 members
extends BlueprintFunctionLibrary
KindNameSignatureDescription
fnPopup_ShowPopup_DefaultPopup(Pawn: Pawn, Outline_Color: PDA_Color, Icon_Color: PDA_Color, Icon: Texture2D, Title_Color: PDA_Color, Title: text, const BodyText: text, ref const ButtonContents: ST_Button_Content[], ref const ButtonPresets: E_UI_Hierarchy[], Sound: SoundBase, __WorldContext: Object, out PopupDefault: WBP_Popup_Default)Adds a default popup to the given pawn's pawn UI at the shipped popup position, fills it in and returns the widget. The pawn needs the Pawn UI ability component and nothing comes back without one; the popup's On Button Clicked delegate is never broadcast by the shipped design, so override On Button Clicked on a popup of your own to react to a press.

Widgets

WBP_Popup_Default9 members
extends WBP_Base
KindNameSignatureDescription
eventInitiatePopup(Outline_Color: PDA_Color, Icon_Color: PDA_Color, Icon: Texture2D, Title_Color: PDA_Color, Title: text, const BodyText: text, ref const ButtonContents: ST_Button_Content[], ref const ButtonPresets: E_UI_Hierarchy[], Sound: SoundBase)Fills the popup in one pass — colours, icon, title, body and buttons — then plays the given sound half a second later so it lands with the appear animation rather than ahead of it. Called for you by Show Popup Default; call it directly only if you spawned the widget yourself.
eventUpdateIcon(Icon: Texture2D)Replaces the icon above the title. The image collapses when no texture is given, so the title moves up to fill the space.
eventUpdateTitle(Text: text)Replaces the popup's title text. The title collapses when the text is empty.
eventUpdateBody(Text: text)Replaces the body text and re-picks its alignment: under fifty characters it is centred, longer text is left-aligned so it stays readable. The body collapses when the text is empty.
eventUpdateButtons(ref const ButtonContents: ST_Button_Content[], ref const ButtonPresets: E_UI_Hierarchy[])Rebuilds the row of buttons along the bottom from the given contents and hierarchy presets, and collapses the row entirely when the contents array is empty. The two arrays are read in step, so the first preset styles the first button.
eventUpdateTitleColor(TitleColor: PDA_Color)Overrides the title colour with a colour asset, ignoring the theme. Use it to mark the popup as a warning or an error.
eventUpdateOutlineColor(OutlineColor: PDA_Color)Overrides the colour of the frame drawn around the popup. This is the strongest signal of severity the popup has, so it is worth setting on anything destructive.
eventUpdateIconColor(Color: PDA_Color)Overrides the tint applied to the icon, ignoring the theme. Pair it with the outline colour so the two agree.
eventOnButtonClicked_1(Group: WBP_Group_Button, Index: int, ID: name)Bound to the popup's button row and left empty on purpose. Override it in a child popup to react to a press without binding the On Button Clicked delegate from outside; the index matches the position in the button content array.