Navigation
API > API/Plugins > API/Plugins/CommonUI
The Load Guard behaves similarly to a Border, but with the ability to hide its primary content and display a loading spinner and optional message while needed content is loaded or otherwise prepared.
Use GuardAndLoadAsset to automatically display the loading state until the asset is loaded (then the content widget will be displayed). For other applications (ex: waiting for an async backend call to complete), you can manually set the loading state of the guard.
| Name | UCommonLoadGuard |
| Type | class |
| Header File | /Engine/Plugins/Runtime/CommonUI/Source/CommonUI/Public/CommonLoadGuard.h |
| Include Path | #include "CommonLoadGuard.h" |
Syntax
UCLASS (MinimalAPI, Config=Game, defaultconfig)
class UCommonLoadGuard : public UContentWidget
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UVisual → UWidget → UPanelWidget → UContentWidget → UCommonLoadGuard
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UCommonLoadGuard
(
const FObjectInitializer& Initializer |
CommonLoadGuard.h |
Classes
| Name | Remarks |
|---|---|
| FOnAssetLoaded |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| BP_OnLoadingStateChanged | FOnLoadGuardStateChangedDynamic | CommonLoadGuard.h |
|
|
| bStyleNoLongerNeedsConversion | bool | Used to track widgets that were created before changing the default style pointer to null | CommonLoadGuard.h | |
| LoadingBackgroundBrush | FSlateBrush | The background brush to display while loading the content | CommonLoadGuard.h |
|
| LoadingText | FText | Loading message to display alongside the throbber | CommonLoadGuard.h |
|
| LoadingThrobberBrush | FSlateBrush | The loading throbber brush | CommonLoadGuard.h |
|
| MyLoadGuard | TSharedPtr< SLoadGuard > | CommonLoadGuard.h | ||
| OnLoadingStateChangedEvent | FOnLoadGuardStateChangedEvent | CommonLoadGuard.h | ||
| SpinnerMaterialPath | FSoftObjectPath | CommonLoadGuard.h |
|
|
| TextStyle | TSubclassOf< UCommonTextStyle > | Style to apply to the loading message | CommonLoadGuard.h |
|
| ThrobberAlignment | TEnumAsByte< EHorizontalAlignment > | The horizontal alignment of the loading throbber & message | CommonLoadGuard.h |
|
| ThrobberPadding | FMargin | The padding of the loading throbber & message | CommonLoadGuard.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void GuardAndLoadAsset
(
const TSoftObjectPtr< ObjectType >& InLazyAsset, |
Displays the loading spinner until the asset is loaded Will pass a casted pointer to the given asset in the lambda callback - could be nullptr if you provide an incompatible type or invalid asset. | CommonLoadGuard.h | |
void GuardAndLoadAsset
(
const TSoftObjectPtr< UObject >& InLazyAsset, |
CommonLoadGuard.h | ||
bool IsLoading() |
CommonLoadGuard.h |
|
|
FOnLoadGuardStateChangedEvent & OnLoadingStateChanged() |
CommonLoadGuard.h | ||
void SetIsLoading
(
bool bInIsLoading |
CommonLoadGuard.h |
|
|
void SetLoadingText
(
const FText& InLoadingText |
CommonLoadGuard.h |
|
Overridden from UPanelWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual UClass * GetSlotClass() |
CommonLoadGuard.h | ||
virtual void OnSlotAdded
(
UPanelSlot* NewSlot |
CommonLoadGuard.h | ||
virtual void OnSlotRemoved
(
UPanelSlot* OldSlot |
CommonLoadGuard.h |
Overridden from UWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual const FText GetPaletteCategory() |
CommonLoadGuard.h | ||
virtual void OnCreationFromPalette() |
CommonLoadGuard.h | ||
virtual void SynchronizeProperties() |
CommonLoadGuard.h |
Overridden from UVisual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ReleaseSlateResources
(
bool bReleaseChildren |
CommonLoadGuard.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostLoad() |
CommonLoadGuard.h | ||
virtual void Serialize
(
FArchive& Ar |
CommonLoadGuard.h |
Protected
Overridden from UWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TSharedRef< SWidget > RebuildWidget() |
CommonLoadGuard.h |