How-To: Buttons & Action Glyphs

Goal: build your project's button base, a destructive-action countdown button, and prompts whose key glyph follows the player's current input device.

1. One button base for the whole project

Subclass Crimson Button Base (UCrimsonButtonBase, a UCommonButtonBase) once, style it, and derive every other button from it. The base adds text plumbing on top of CommonUI's button:

MemberKindUse
SetButtonText(Text)BlueprintCallableSets the label at runtime (respects the ButtonText override property).
UpdateButtonText(Text)BlueprintImplementableEventImplement in your Blueprint: receive the text and push it into your TextBlock.
UpdateButtonStyle()BlueprintImplementableEventImplement to restyle when the input method changes (called on construct and on input-method change).
ButtonTextEditAnywhere (with override checkbox)Design-time label.
Reference implementation
Open the shipped W_CrimsonButton (/CrimsonUI/UI/Foundation/Buttons/): a CommonTextBlock label in the Designer, with the Update Button Text and Update Button Style events implemented in the graph. W_CrimsonMenuButton and W_CrimsonArrowButton (/CrimsonUI/UI/Menu/) are styled variants built on the same base - study them for how one base fans out into a button family.
Verify
Dropping WBP_ButtonBase into any screen shows the label from ButtonText; calling Set Button Text updates it.

2. Countdown confirm for destructive actions

StartActivationCountdown(Delay) (BlueprintCallable) disables the button for Delay seconds - use it on 'Delete character'-style confirms so the player cannot double-click through. The dialog system drives this automatically from FCrimsonConfirmationDialogAction::ActivationDelay.

Wiring: on the destructive confirm button, Event On Construct -> Start Activation Countdown (Delay = 3.0). The button disables itself and re-enables when the countdown ends.

3. Buttons that show their bound key

Crimson Bound Action Button (UCrimsonBoundActionButton) is a UCommonBoundActionButton that swaps its style class per input method - set KeyboardStyle, GamepadStyle, and TouchStyle in defaults and CommonUI fills the key glyph from the bound action. Use it for the action bar CommonUI renders for activatable widgets.

Crimson Action Widget (UCrimsonActionWidget) is the lighter option when you only need a key icon, not a button: it is a UCommonActionWidget whose GetIconForKey(Key) (BlueprintCallable) resolves icons through the Enhanced Input subsystem.

Reference implementation
Open the shipped W_CrimsonBoundActionButton (/CrimsonUI/UI/Foundation/Widgets/BottomBar/): its Class Defaults set KeyboardStyle / GamepadStyle / TouchStyle to three CommonButtonStyle assets (the shipped Crimson-ButtonStyle-* styles). W_CrimsonBottomActionBar in the same folder is the bound-action bar that hosts it.
Verify
Switching input device in PIE (press a gamepad button vs move the mouse) swaps the button style and glyph live.

See also

  • How-To: Show Confirmation Dialogs - the entry box spawns your UCrimsonButtonBase subclass.
  • How-To: Tabs - tab buttons derive from the same button base.