|Go to Page...|
Notifications is an addon that does nothing by itself, but allows other addons to easily show a notification banner at the top of the screen which can display a message + the name of the addon, an icon, play a sound, animate when showing and hiding, and optionally execute a function when clicked. If no icon is provided, the default icon is shown.
If more notifications come in while one is still showing, they will be displayed one by one, so you have time to read and react to each of them.
Additionally, when you are away, these notifications are stored and shown to you as soon as you come back. If you have unread notifications when you log out, they will be shown to you when you log back in.
Moving the cursor over the banner prevents it from disappearing as long as the cursor is in place. Clicking it will execute the function specified by the addon upon display if present, and dismiss the banner. Right-clicking will only dismiss the banner. To dismiss all incoming banners with one click, hold shift.
Type '/testalert' to show a test notification. '/testalert true' shows a custom icon.
Examples of usage in addons is notifying you of incoming mail, calendar events, whispers while you are afk, UI messages, etc. It all depends on the people implementing it.
There are in-game options for simple settings. These can be accessed through the default AddOns settings panel, or by typing /notifications.
Users can also change all options including appearance at the top of notifications.lua, including appearance and animation behaviour. Explanation is added where necessary.
Developers who include Notifications in their UI can modify it in their code, allowing users to update Notifications without needing to edit the lua code. Read the 'Developer' section below for more info.
EventNotifier - alerts you of mail, calendar events and guild events.
Please report all issues at my GitHub.
Showing a notification is easy. There is only one function used for this:
- Notifications:Alert(message, clickFunc, texture, ...)
## OptionalDeps: Notifications, Tukui
- if Notifications and Tukui then
- -- locally import option table references
- local options = Notifications.options
- local _, C = unpack(Tukui)
- local borderR, borderG, borderB = unpack(C.general.bordercolor)
- -- set the new values
- options.bgRed, options.bgGreen, options.bgBlue = unpack(C.general.backdropcolor)
- options.bgAlpha = 1
- options.borderRed, options.borderGreen, options.borderBlue = borderR, borderG, borderB
- options.separatorRed, options.separatorGreen, options.separatorBlue = borderR, borderG, borderB
- options.inset = -1
- -- call the update function