Home › Systems › AFS_UI_InfoPanels
System

AFS_UI_InfoPanels

Screen-space info panels shown through the HUD ability, with a one-call library for showing, toggling and removing them.

What it gives you

  • Persistent screen-space panels
  • Show, toggle, remove and query from one library
  • Automatic HUD hosting

Requires

AFL_Libraries AFS_UI

Required by

AFM_Spectator AFU_Debug AF_Examples

3 assets14 API members

Description

Info panels are persistent screen-space surfaces for information the player refers back to — stats, instructions, debug readouts. They differ from notifications in that they stay until dismissed, and from popups in that they are not modal.

BFL_InfoPanel creates the hosting panel on the HUD ability if it does not exist yet, so a single call is enough from a cold start.

Setup

  1. Confirm the pawn has BPC_PawnAbility_HUD.
  2. Call InfoPanel_Show with your widget class.

Usage

Showing and toggling

InfoPanel_Show adds a panel, InfoPanel_Toggle flips it, InfoPanel_Remove removes it and InfoPanel_IsVisible queries it. All take the widget class as the key, so you never hold a reference.

An info panel open beside its subject
AFS_UI_InfoPanels_result.pngAn info panel open beside its subject
An info panel open beside its subject

Key properties

PropertyWhen to change
Widget classActs as the panel's identity — one panel per class

Extending

Derive your panel content from WBP_Base; derive from WBP_InfoPanel to change the hosting frame.

Example map

Map_Examples_InfoPanels shows several panels. AFU_Debug uses this system for its stat readouts.

Troubleshooting

Calling Show twice creates nothing new. Panels are keyed by widget class by design — use a different class for a second panel.

API reference

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

Libraries

BFL_InfoPanel4 members
extends BlueprintFunctionLibrary

Function library for the stacked info panels on the pawn's head-up display. Show, Toggle, Remove and Is Visible each take the pawn and a widget class, adding the panel to the display the first time one is asked for. Call these statically rather than creating the panel yourself; the pawn needs the head-up display ability.

KindNameSignatureDescription
fnInfoPanel_IsVisibleInfoPanel(Pawn: Pawn, WidgetClass: class<WBP_Base>, __WorldContext: Object, out IsShown: bool)Reports whether a card of this widget class is currently in the pawn's stack. Returns false when no panel exists at all, so it can be called before anything has been shown.
fnInfoPanel_RemoveInfoPanel(Pawn: Pawn, WidgetClass: class<WBP_Base>, __WorldContext: Object)Closes the info card for this widget class, playing its exit animation. Does nothing if no panel is on screen; the panel itself closes once its last card is gone.
fnInfoPanel_ToggleInfoPanel(Pawn: Pawn, WidgetClass: class<WBP_Base>, References: Struct_References, __WorldContext: Object)Shows the info card for this widget class if it is hidden and closes it if it is showing. The usual way to wire a card to a button or a key.
fnInfoPanel_ShowInfoPanel(Pawn: Pawn, WidgetClass: class<WBP_Base>, References: Struct_References, __WorldContext: Object, out InfoWidget: WBP_Base)Adds an info card of the given widget class to the pawn's stack and returns the widget inside it, creating the containing panel on the pawn's HUD first if this is the first card. Asking for a class that is already showing does nothing, so it is safe to call repeatedly.

Widgets

WBP_InfoElement3 members
extends WBP_Base

Frame around one widget inside an info panel: it hosts the widget in a switcher, pops in when spawned, and plays that animation backwards before removing itself and telling the panel it has gone. Created by the info panel rather than placed in a hierarchy of your own.

KindNameSignatureDescription
varWidgetContentclass<WBP_Base>Class of the widget shown inside this card. Set on spawn by the panel; the card is only a frame with a close button, and this is what fills it.
eventDespawn()Plays the pop-in animation in reverse, drops the card behind its neighbours while it shrinks, then broadcasts On Info Element Closed and removes itself. Use this rather than Remove From Parent so the panel is told to restack.
eventWidgetElement_PostInitiateStyle()Hook that runs after the card has been built. Empty in this class; override it in a card design that needs to set itself up once its inner widget exists.
WBP_InfoPanel7 members
extends WBP_Base

Panel stacking the open info widgets down one corner of the screen, each in its own element, interpolating them into place as the stack changes and closing itself once the last one is gone. Added to the head-up display by the info panel library, which is what you should call; there is no need to create it directly.

KindNameSignatureDescription
fnIsPanelSpawnedPanel(Widget: class<WBP_Base>, out IsShown: bool)Reports whether the stack currently holds a card of this widget class.
fnInfoPanel_TogglePanel(WidgetClass: class<WBP_Base>)Closes the card for this widget class if it is in the stack, otherwise opens one.
fnDespawnPanelWidgetPanel(Widget: class<WBP_Base>)Starts the closing animation on the card for this widget class and forgets it, so a card of the same class can be opened again immediately. The card removes itself from the list when the animation finishes.
fnSpawnPanelWidgetPanel(WidgetClass: class<WBP_Base>, out InfoWidget: WBP_Base)Creates a card for the given widget class, anchors it to the top right of the panel, subscribes to its close event and returns the widget built inside it. Asking for a class already in the stack returns nothing, which is what keeps cards unique.
fnTickPanelPositionPositioning(DeltaTime: float)Eases every card towards its place in the stack, walking the list from the bottom up and offsetting each by the height of the one before it. Call it every frame from the owning HUD so cards slide into the gap when one closes instead of jumping.
eventAssignCloseWidget(Target: WBP_InfoElement)Subscribes the panel to a card's closed event so the stack can restack when that card goes away. Called for you by Spawn Panel Widget.
eventOnInfoElementClosed(InfoElement: WBP_InfoElement)Drops a closed card from the stack, unsubscribes from it, and closes the whole panel once the last card has gone so no empty frame is left on the HUD.