Notifications

The Notification feature billboard in the Example Map demonstrates this features when you click on the megaphones.

The notifications system queues and displays notifications passed to clients as packed structs. You can specify the parameters that you want to pass to these structs.

Sending Notifications

You can either send a notification to the local client as a local notification, or to send a global notification to all clients.

Local Notification Example

Global Notification Example

Notification Data

A notification requires three variables to be sent:

  • Notification Type: An identifier for the notification system to store the notification. This does not have to be unique.

  • Notification Time: The notification's display duration.

  • Notification Payload: A morpheus packed struct that wraps any struct you want to pass.

Displaying Notifications

To display notifications in the user interface you need to hook a widget blueprint up to events sent by the notifications singleton. WBP_M2Example_NotificationsDisplay is one such widget blueprint, it binds to the delegates as follows:

All Notifications System Functions

  • Send Local Notification: Send a notification to the local client

  • Send Global Notification: Send a notification to all clients

  • Remove Notifications by Type: Remove notifications of type

  • Remove Notifications by Id: Remove notification with Id

  • Remove All Notifications: Removes all notifications

Changing the queueing order

If the you want to change the way notifications are ordered in the queue, create a blueprint with parent M2M_NotificationsSingleton and override the GetNextNotificationIndex function. Here's an example of last in first out (LIFO) ordering:

Example Get Next Notification Index override

After creating this blueprint class, you need to assign it as the notifications system singleton class under: World Settings -> Notifications Singleton Class.

Last updated

Was this helpful?