📢Notifications
Last updated
Last updated
Note that the tools demonstrated in this page are accessible from MSquared v22
The notifications system queues and displays notifications passed to clients as packed structs. Users can specify the parameters they want to pass to these structs.
A notification requires three variables to be sent:
Notification Type: An indentifier for the notification system to store the notifications (doesn't require uniqueness)
Notification Time: The notification display duration
Notification Payload: A morpheus packed struct that wraps any struct the user wants to pass
You can either send a notification to the local client as a local notification or to send a global notification which would be sent to all clients
To display notifications on the user interface, we should hook the widget to events sent by the notifications singleton. Notifications sent will also send a notification ID which is used to uniquely identify notifications.
An example can be found in WBP_NotificationsDisplayExample which binds to the delegates as follows:
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
If the user wants to change the way notifications are ordered in the queue, they can create a blueprint with parent M2M_NotificationsSingleton and override the GetNextNotificationIndex function. An example last in first out example is:
After creating this blueprint class, we need to assign it as the notifications system singleton class under: World Settings -> Notifications Singleton Class