Navigation
API > API/Plugins > API/Plugins/CommonUI
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UVisual
- UWidget
- UUserWidget
- UCommonUserWidget
- UCommonButtonBase
- UCommonBoundActionButton
- UCommonRotator
References
| Module | CommonUI |
| Header | /Engine/Plugins/Runtime/CommonUI/Source/CommonUI/Public/CommonButtonBase.h |
| Include | #include "CommonButtonBase.h" |
Syntax
UCLASS&40;Abstract, Blueprintable, ClassGroup&61;UI, Meta&61;&40;Category&61;"Common UI", DisableNativeTick&41;&41;
class UCommonButtonBase : public UCommonUserWidget
Remarks
Button that disables itself when not active. Also updates actions for CommonActionWidget if bound to display platform-specific icons.
Variables
| Type | Name | Description | |
|---|---|---|---|
| uint8: 1 | bApplyAlphaOnDisable | The type of mouse action required by the user to trigger the button's 'Click' | |
| uint8: 1 | bDisplayInputActionWhenNotInteractable | True if the input action should be displayed when the button is not interactable | |
| bool | bHideInputAction | Whether to hide the input action widget at all times (useful for textless small buttons) | |
| uint8: 1 | bHideInputActionWithKeyboard | True if the input action should be hidden while the user is using a keyboard | |
| uint8: 1 | bInteractableWhenSelected | If true, the button may be clicked while selected. | |
| uint8: 1 | bLocked | True if this button is currently locked. | |
| uint8: 1 | bRequiresHold | True if this button should have a press and hold behavior, triggering the click when the specified hold time is met | |
| uint8: 1 | bSelectable | True if the button supports being in a "selected" state, which will update the style accordingly | |
| uint8: 1 | bShouldSelectUponReceivingFocus | If true, the button will be selected when it receives focus. | |
| uint8: 1 | bShouldUseFallbackDefaultInputAction | True if this button should use the default fallback input action (bool is useful for buttons that shouldn't because they are never directly hit via controller) | |
| bool | bSimulateHoverOnTouchInput | True if this button should play the hover effect when pressed by a touch input | |
| bool | bStyleNoLongerNeedsConversion | Used to track widgets that were created before changing the default style pointer to null | |
| uint8: 1 | bToggleable | True if the button can be deselected by clicking it when selected | |
| uint8: 1 | bTriggerClickedAfterSelection | ||
| FWidgetEventField | ClickEvent | ||
| TEnumAsByte< EButtonClickMethod::Type > | ClickMethod | The type of mouse action required by the user to trigger the button's 'Click' | |
| float | CurrentHoldTime | Current hold time for this button | |
| TSubclassOf< UCommonUIHoldData > | HoldData | Press and Hold values used for Keyboard and Mouse, Gamepad and Touch, depending on the current input type | |
| FTSTicker::FDelegateHandle | HoldProgressRollbackTickerHandle | Handle for ticker spawned for button hold rollback | |
| float | HoldRollbackTime | Time (in seconds) for hold progress to go from 1.0 (completed) to 0.0. | |
| FTSTicker::FDelegateHandle | HoldTickerHandle | Handle for ticker spawned for press and hold | |
| float | HoldTime | Press and hold time in seconds | |
| FSlateSound | HoveredSlateSoundOverride | Optional override for the sound to play when this button is hovered. | |
| TObjectPtr< UCommonActionWidget > | InputActionWidget | Optionally bound widget for visualization behavior of an input action; NOTE: If specified, will visualize according to the following algorithm: If TriggeringEnhancedInputAction is specified, visualize it else: If TriggeringInputAction is specified, visualize it else: If TriggeredInputAction is specified, visualize it else: Visualize the default click action while hovered | |
| int32 | InputPriority | This is the priority for the TriggeringInputAction. | |
| FSlateSound | LockedHoveredSlateSoundOverride | Optional override for the sound to play when this button is hovered while Locked | |
| FSlateSound | LockedPressedSlateSoundOverride | Optional override for the sound to play when this button is pressed while Locked | |
| int32 | MinHeight | The minimum height of the button (only used if greater than the style's minimum) | |
| int32 | MinWidth | The minimum width of the button (only used if greater than the style's minimum) | |
| FCommonButtonBaseClicked | OnButtonBaseClicked | ||
| FCommonButtonBaseClicked | OnButtonBaseDoubleClicked | ||
| FCommonButtonBaseClicked | OnButtonBaseHovered | ||
| FCommonButtonBaseClicked | OnButtonBaseUnhovered | ||
| FCommonSelectedStateChangedBase | OnSelectedChangedBase | ||
| FSlateSound | PressedSlateSoundOverride | Optional override for the sound to play when this button is pressed. | |
| TEnumAsByte< EButtonPressMethod::Type > | PressMethod | ||
| FSlateSound | SelectedHoveredSlateSoundOverride | Optional override for the sound to play when this button is hovered while Selected | |
| FSlateSound | SelectedPressedSlateSoundOverride | Optional override for the sound to play when this button is pressed while Selected | |
| TSubclassOf< UCommonButtonStyle > | Style | References the button style asset that defines a style in multiple sizes | |
| TEnumAsByte< EButtonTouchMethod::Type > | TouchMethod | ||
| FDataTableRowHandle | TriggeredInputAction | The input action that can be visualized as well as triggered when the user clicks the button. | |
| FUIActionBindingHandle | TriggeringBindingHandle | ||
| TObjectPtr< UInputAction > | TriggeringEnhancedInputAction | The enhanced input action that is bound to this button. | |
| FDataTableRowHandle | TriggeringInputAction | The input action that is bound to this button. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UCommonButtonBase
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | Helper function to bind to input method change events | ||
| void | Associates this button at its priority with the given key | ||
| void | BP_OnClicked () |
||
| void | |||
| void | |||
| void | |||
| void | BP_OnEnabled () |
||
| void | |||
| void | |||
| void | BP_OnHovered () |
||
| void | BP_OnInputMethodChanged
(
ECommonInputType CurrentInputType |
||
| void | |||
| void | |||
| void | BP_OnLockedChanged
(
bool bIsLocked |
||
| void | BP_OnPressed () |
||
| void | |||
| void | |||
| void | |||
| void | |||
| UCommonButtonInternalBase * | |||
| void | DisableButtonWithReason
(
const FText& DisabledReason |
Disables this button with a reason (use instead of SetIsEnabled) | |
| void | : DarenC - API decision, consider removing | ||
| bool | GetButtonAnalyticInfo
(
FString& ButtonName, |
||
| bool | By default, if bRequiresHold is true, the bound Input Action will be forced to require hold as well. | ||
| void | GetCurrentButtonPadding
(
FMargin& OutButtonPadding |
||
| void | GetCurrentCustomPadding
(
FMargin& OutCustomPadding |
||
| UCommonTextStyle * | |||
| TSubclassOf< UCommonTextStyle > | |||
| UInputAction * | Gets the appropriate enhanced input action that is set | ||
| bool | GetInputAction
(
FDataTableRowHandle& InputActionRow |
Gets the appropriate input action that is set | |
| ECommonInputMode | |||
| bool | Gets the bIsFocusable flag | ||
| bool | GetLocked () |
||
| bool | GetSelected () |
||
| bool | Get whether the button should become selected upon receiving focus or not | ||
| UMaterialInstanceDynamic * | Returns the dynamic instance of the material being used for this button, if it is using a single material style. | ||
| UCommonButtonStyle * | GetStyle () |
Current button style | |
| const UCommonButtonStyle * | GetStyleCDO () |
||
| void | Handler function registered to the underlying button's click. | ||
| FReply | Handler function registered to the underlying button's double click. | ||
| void | Helper function registered to the underlying button when pressed | ||
| void | Helper function registered to the underlying button when released | ||
| void | Helper function registered to the underlying button losing focus | ||
| void | Helper function registered to the underlying button receiving focus | ||
| void | |||
| void | HandleTriggeringActionCommited
(
bool& bPassthrough |
||
| void | HoldReset () |
||
| bool | Is this button currently interactable? (use instead of GetIsEnabled) | ||
| bool | |||
| bool | IsPressed () |
Is this button currently pressed? | |
| void | |||
| void | NativeOnActionProgress
(
float HeldPercent |
Bound to the hold progress of the bound key from the input action | |
| void | |||
| void | Allows derived classes to take action when the current text style has changed | ||
| void | NativeOnDeselected
(
bool bBroadcast |
||
| void | |||
| void | |||
| void | |||
| bool | NativeOnHoldProgress
(
float DeltaTime |
Bound to the hold progress not related to the bound key | |
| bool | NativeOnHoldProgressRollback
(
float DeltaTime |
Bound to the hold progress rollback not related to the bound key | |
| void | |||
| void | |||
| void | |||
| void | NativeOnSelected
(
bool bBroadcast |
||
| void | |||
| void | Callback fired when hold events complete | ||
| void | OnActionProgress
(
float HeldPercent |
Callback fired continously during hold interactions | |
| FCommonButtonEvent & | OnClicked () |
||
| void | Allows derived classes to take action when the current text style has changed | ||
| FCommonButtonEvent & | |||
| FCommonButtonEvent & | OnFocusLost () |
||
| FCommonButtonEvent & | |||
| FCommonButtonEvent & | OnHovered () |
||
| void | OnInputMethodChanged
(
ECommonInputType CurrentInputType |
Called via delegate when the input method changes | |
| FOnIsSelectedChanged & | |||
| FCommonButtonEvent & | |||
| FCommonButtonEvent & | |||
| FCommonButtonEvent & | OnPressed () |
||
| FCommonButtonEvent & | OnReleased () |
||
| void | OnTriggeredInputActionChanged
(
const FDataTableRowHandle& NewTriggeredAction |
Callback fired when input action datatable row changes | |
| void | OnTriggeringEnhancedInputActionChanged
(
const UInputAction* InInputAction |
Callback fired when enhanced input action changes | |
| void | OnTriggeringInputActionChanged
(
const FDataTableRowHandle& NewTriggeredAction |
Callback fired when triggered input action datatable row changes | |
| FCommonButtonEvent & | OnUnhovered () |
||
| void | |||
| void | SetClickMethod
(
EButtonClickMethod::Type InClickMethod |
Set the click method for mouse interaction | |
| void | SetHideInputAction
(
bool bInHideInputAction |
||
| void | SetHoveredSoundOverride
(
USoundBase* Sound |
||
| void | SetInputActionProgressMaterial
(
const FSlateBrush& InProgressMaterialBrush, |
||
| void | SetIsFocusable
(
bool bInIsFocusable |
Updates the bIsFocusable flag | |
| void | SetIsInteractableWhenSelected
(
bool bInInteractableWhenSelected |
Change whether this widget is selectable at all. If false and currently selected, will deselect. | |
| void | SetIsInteractionEnabled
(
bool bInIsInteractionEnabled |
Change whether this widget is selectable at all. If false and currently selected, will deselect. | |
| void | SetIsLocked
(
bool bInIsLocked |
Change whether this widget is locked. | |
| void | SetIsSelectable
(
bool bInIsSelectable |
Change whether this widget is selectable at all. If false and currently selected, will deselect. | |
| void | SetIsSelected
(
bool InSelected, |
Change the selected state manually. | |
| void | SetIsToggleable
(
bool bInIsToggleable |
Change whether this widget is toggleable. If toggleable, clicking when selected will deselect. | |
| void | SetLockedHoveredSoundOverride
(
USoundBase* Sound |
||
| void | SetLockedPressedSoundOverride
(
USoundBase* Sound |
||
| void | SetMinDimensions
(
int32 InMinWidth, |
Sets the minimum dimensions of this button | |
| void | SetPressedSoundOverride
(
USoundBase* Sound |
||
| void | SetPressMethod
(
EButtonPressMethod::Type InPressMethod |
Set the click method for keyboard/gamepad button press interaction | |
| void | SetSelectedHoveredSoundOverride
(
USoundBase* Sound |
||
| void | SetSelectedInternal
(
bool bInSelected, |
Internal method to allow the selected state to be set regardless of selectability or toggleability | |
| void | SetSelectedPressedSoundOverride
(
USoundBase* Sound |
||
| void | SetShouldSelectUponReceivingFocus
(
bool bInShouldSelectUponReceivingFocus |
Set whether the button should become selected upon receiving focus or not; Only settable for buttons that are selectable | |
| void | SetShouldUseFallbackDefaultInputAction
(
bool bInShouldUseFallbackDefaultInputAction |
Change whether this widget should use the fallback default input action. | |
| void | SetStyle
(
TSubclassOf< UCommonButtonStyle > InStyle |
Sets the style of this button, rebuilds the internal styling | |
| void | SetTouchMethod
(
EButtonTouchMethod::Type InTouchMethod |
Set the click method for touch interaction | |
| void | SetTriggeredInputAction
(
const FDataTableRowHandle& InputActionRow |
Updates the current triggered action | |
| void | SetTriggeringEnhancedInputAction
(
UInputAction* InInputAction |
Updates the current triggering enhanced input action, requires enhanced input enabled in CommonUI settings | |
| void | SetTriggeringInputAction
(
const FDataTableRowHandle& InputActionRow |
Updates the current triggering action | |
| void | Unless this is called, we will assume the double click should be converted into a normal click. | ||
| void | Helper function to unbind from input method change events | ||
| void | Associates this button at its priority with the given key | ||
| void | UpdateHoldData
(
ECommonInputType CurrentInputType |
If HoldData is valid, assigns its values to Keyboard and Mouse, Gamepad and Touch, based off the Current Input Type. | |
| void | Helper function to update the associated input action widget, if any, based upon the state of the button | ||
| void |
Overridden from UUserWidget
| Type | Name | Description | |
|---|---|---|---|
| bool | Initialize () |
||
| void | |||
| void | |||
| bool | |||
| void | NativeOnFocusLost
(
const FFocusEvent& InFocusEvent |
||
| FReply | NativeOnFocusReceived
(
const FGeometry& InGeometry, |
||
| void | NativeOnMouseEnter
(
const FGeometry& InGeometry, |
||
| void | NativeOnMouseLeave
(
const FPointerEvent& InMouseEvent |
Overridden from UWidget
| Type | Name | Description | |
|---|---|---|---|
| const FText | Gets the palette category of the widget | ||
| bool | IsHovered () |
Returns true if the widget is currently being hovered by a pointer device | |
| void | Called after constructing a new widget from the palette. | ||
| void | Function called after the underlying SWidget is constructed. | ||
| void | SetIsEnabled
(
bool bInIsEnabled |
Sets the current enabled status of the widget | |
| void | Applies all properties to the native widget if possible. |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FCommonButtonEvent | |||
| FOnIsSelectedChanged |