Limen Framework 0.1 Help

ALimenBaseHUD

Overview

ALimenBaseHUD is a custom HUD class designed to manage various UI widgets within the game. It inherits from AHUD and provides functionality to show, hide, and update widgets based on player controller and pawn interactions. The class also includes methods for initializing and destroying widgets, as well as handling forced HUD states.

Properties

Type

Name

Access

Description

uint8

bAreWidgetsInitialized

Private

A bit flag indicating whether the widgets have been initialized.

uint8

bForceHideHud

Private

A bit flag indicating whether the HUD should be forced to hide.

TArray<TWeakObjectPtr<[ULimenWidget](LimenWidget.md)>>

WidgetList

Protected

A list of weak pointers to all managed widgets.

Functions

Return Type

Signature

Description

void

ShowHUD()

Shows the active widget if it is valid.

void

HideHUD()

Hides the active widget if it is valid.

void

ForceHUDState(const bool bForce)

Sets the forced HUD state.

bool

GetForcedHudState() const

Returns the current forced HUD state.

void

ShowActiveWidget()

Shows the currently active widget.

void

HideActiveWidget()

Hides the currently active widget.

ULimenWidget*

GetActiveWidget() const

Returns a pointer to the currently active widget.

TArray<TWeakObjectPtr<[ULimenWidget](LimenWidget.md)>>

GetWidgetList() const

Returns an array of weak pointers to all managed widgets.

void

EndPlay(const EEndPlayReason::Type EndPlayReason)

Cleans up and destroys all widgets when the HUD is destroyed.

void

DestroyWidgets()

Placeholder for destroying all widgets. Currently does nothing.

void

InitializeWidgets()

Placeholder for initializing all widgets. Currently does nothing.

void

HudInitialized(APlayerController* PlayerController)

Called after the HUD has been initialized with a player controller.

void

UpdateWidgets(APlayerController* PlayerController, APawn* Pawn)

Updates the state of the HUD based on the player controller and pawn.

bool

CanSwitchWidgetVisibility(UWidget* InWidget) const

Determines if a widget can be shown or hidden based on the forced HUD state.

void

ShowWidget_Internal(ULimenWidget* Widget)

Internal method to show a widget, ensuring it is valid and not already showing.

void

HideWidget_Internal(ULimenWidget* Widget)

Internal method to hide a widget, ensuring it is valid and currently showing.

void

AddWidgetToList(ULimenWidget* InWidget)

Adds a widget to the internal list of managed widgets.

void

RemoveWidgetFormList(ULimenWidget* InWidget)

Removes a widget from the internal list of managed widgets.

Usage & Implementation Notes

  • Threading Constraints: This class is designed to be used within the Unreal Engine's game thread.

  • Replication Requirements: None.

  • Memory Lifetime Management: Widgets are managed using weak pointers, ensuring that they can be safely destroyed without causing memory leaks.

  • Initialization Dependencies: The UpdateWidgets method should be called with a valid player controller and pawn to properly initialize the HUD.

22 May 2026