Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Notifications

James Wilkinson edited this page Aug 11, 2017 · 1 revision

Notifications can be added to the BLT notifications panel in order to send important information to users, such as newer versions of your mods being available for download.

The global notifications manager can be accessed from the BLT using the BLT.Notifications object.

int add_notification( table parameters )

Adds a notification to the manager and displays it immediately.
parameters A table containing the information of the notification

  • title The title of the notification

  • [text] The descriptive text

  • [icon] A path to a texture to use as an icon with this notification

  • [icon_texture_rect] The rect to use to clip the texture if using an atlas texture

  • [color] The color the icon should be tinted to

  • [priority] The priority of the notification, higher values are shown first returns A unique id for the notification created

    local notif_id = BLT.Notifications:add_notification( { title = "Test notification", text = "A message that you should read", } )

nil remove_notification( int uid )

Removes the notification from the manager and the gui with the specified id.
uid The unique id of the notification that you wish to remove

BLT.Notifications:remove_notification( notif_id )
Clone this wiki locally