Skip to main content

Button ListView Entry

Base:
UUserWidget
Type:
UNButtonListViewEntry + UNButtonListViewEntryObject
Header File:
NexusUI/Public/Widgets/NButtonListViewEntry.h

A reusable UNListView entry widget that renders a UButton with a child UCommonTextBlock label, driven by a bound UNButtonListViewEntryObject data model. Hover, press, and release transitions swap the button's foreground/background colors using palette slots on the bound data object — so a single Blueprint widget can render rows in any color scheme by populating the data object's per-state ENColor fields.

Used by the UNActorPools and UNDynamicRefs developer overlays as the per-object button rows you click to focus an actor.

What It Is​

  • Two-Type Pattern: UNButtonListViewEntry is the widget; UNButtonListViewEntryObject is the UObject row data fed into the UNListView. Each row's data object carries the label text, a TargetObject payload, and per-state palette colors.
  • Hover/Press/Release: Native click and pointer events recolor the button and label using the bound data object's palette slots.
  • Click Forwarding: Pressing the button fires the data object's OnPressedEvent delegate, passing the row's TargetObject to subscribers.

Bound Widgets​

WidgetTypeRole
ButtonUButtonThe pressable surface; click/hover events drive the color transitions.
TextUCommonTextBlockThe button's label, pulled from the bound data object's Text field.

Behavior​

  • NativeConstruct() wires Button->OnClicked, OnHovered, OnUnhovered, and OnReleased to internal handlers that recolor the button.
  • NativeOnListItemObjectSet(UObject*) receives the UNButtonListViewEntryObject, copies its label into Text, and binds the button's OnClicked to the object's OnPressed so the click forwards out via OnPressedEvent.
  • NativeOnEntryReleased() unbinds the row from the data object when the list view recycles the row.
  • NativeDestruct() unwires every button delegate, including when the bound Button has already been torn down.

Data Object — UNButtonListViewEntryObject​

UCLASS(BlueprintType)
class NEXUSUI_API UNButtonListViewEntryObject : public UObject

The data model is a plain UObject (not the widget itself) that the list view binds to one row. The widget reads the following fields when its row is created:

FieldDefaultPurpose
TextemptyLabel rendered in the button.
TargetObjectnullptrArbitrary payload forwarded to OnPressedEvent subscribers.
HoverStateForegroundColorNC_WhiteText color while the pointer hovers.
HoverStateBackgroundColorNC_BlueLightButton color while the pointer hovers.
PressedStateForegroundColorNC_WhiteText color while pressed.
PressedStateBackgroundColorNC_BlueDarkButton color while pressed.
UnhoveredStateForegroundColorNC_WhiteIdle text color.
UnhoveredStateBackgroundColorNC_GreyDarkIdle button color.

The data object also exposes an OnPressedEvent delegate that fires when the bound button is clicked — subscribers receive the row's TargetObject for context.

tip

Construct one UNButtonListViewEntryObject per row, set its Text and TargetObject, bind your handler to OnPressedEvent, then push the array of objects into a UNListView configured to use UNButtonListViewEntry (or a Blueprint subclass of it). The plugin's developer overlays follow this pattern verbatim.