EZNotifications UE Plugin
  • Overview
    • 👋Welcome!
    • 🔗Links
  • Getting Started
    • 📺Getting Started Tutorial
    • Setup UMG
    • Add Animations
    • Show Notification
    • Show Alert
    • Concurrent Notifications
    • Duration timeline
  • Info
    • Logging
    • NotificationSubsystem
    • NotificationSettings struct
    • ⚙️Plugin Settings
Powered by GitBook
On this page
  • Setup Buttons
  • Blueprint
  • C++
  1. Getting Started

Show Alert

PreviousShow NotificationNextConcurrent Notifications

Last updated 1 year ago

Alert is just like notification just that it has an option to have up to 2 buttons and wait for the user to click one of the buttons.

For that case, I made an async call that will return when one of the buttons clicked, or when the duration of the alert is timed out.

Just like in the previous page, there's a function called ShowAlert that takes a widget of type AlertWidget.

AlertWidget is a child of NotificationWidget.

Setup Buttons

To setup delegates for the buttons so they could work with this async node, we need to call does 2 functions.

Simply create a button, bind the on-click delegate, and call the matching action that you need.

Once you call the functions you need from the user widget, you are ready to go.

OnRemovedFromParent will be called either on a button click or when the widget is removed from the parent.

Blueprint

C++

UAsyncAlertWidget* AlertWidget = UAsyncAlertWidget::ShowAlert(this, /*AlertWidget object goes here*/);
AlertWidget->OnPrimaryButtonClicked.AddDynamic(...);
AlertWidget->OnSecondaryButtonClicked.AddDynamic(...);
AlertWidget->OnRemovedFromParent.AddDynamic(...);
AlertWidget->Activate();
The design is only for demonstrating the plugin functionalities.