Go to Page... |
Compatibility: | Endless Archive (9.2.5) base-game patch (9.1.5) |
Updated: | 10/29/23 01:07 PM |
Created: | 11/03/15 08:20 PM |
Monthly downloads: | 9,423 |
Total downloads: | 1,069,973 |
Favorites: | 692 |
MD5: |
Developers.What does it do?
Allows you to add messages to the games notification area.
How do I use it?
Register the library in your code file:How do I create a Message?
Lua Code:
local libNotification = LibNotification
After your addon is initialized call the libraries CreateProvider() function.
Lua Code:
local provider = libNotification:CreateProvider()
The provider will have a notifications table. This is where you put your messages.
Lua Code:
provider.notifications
Other Information
Messages need to be written in a certain format, the following is an example:
Warning: Spoiler
Lua Code:
local msg = { dataType = NOTIFICATIONS_ALERT_DATA, secsSinceRequest = ZO_NormalizeSecondsSince(0), note = "Use it wisely", message = "Add custom notification messages", heading = "LibNotifications", texture = "/esoui/art/miscellaneous/eso_icon_warning.dds", shortDisplayText = "Custom Notification", controlsOwnSounds = true, keyboardAcceptCallback = OnKeyboardAccept, keyboardDeclineCallback = OnKeyboardDecline, gamepadAcceptCallback = OnGamepadAccept, gamepadDeclineCallback = OnGamepadDecline, data = {}, -- Place any custom data you want to store here }
So what do all of those keys do?
dataType's and what buttons are available with them:
NOTIFICATIONS_REQUEST_DATA -- note, accept (checkmark), & decline (x) buttons
NOTIFICATIONS_WAITING_DATA -- shows a spinning wheel (no message text, note, accept, or decline)
NOTIFICATIONS_ALERT_DATA -- note & delete (x) buttons
secsSinceRequest: Is used for sorting the notifications (in descending order). You should use ZO_NormalizeSecondsSince(0), which is the seconds since login. This will keep the notifications in order, newest notifications on top. Note since it sorts in descending order the keyName is misleading. Its not really the seconds since request, ZOS named it, not me.
note: In keyboard mode this is the tooltip text for the note button. If you leave out the note, the note button will be hidden automatically. In gamepad mode it is just displayed as text after the message. See gamepad picture for an example.
message: The message text to be displayed.
heading: In keyboard mode this is the heading text to be displayed (next to the icon). In gamepad mode this is used as a category header for all messages displayed by your provider. See gamepad picture for an example. *Warning: You can NOT display more than one heading/category at a time in gamepad mode (without creating multiple providers). In gamepad mode the category heading will be named after this key/value from the FIRST msg in your list. Changing the heading name on other messages in your notifications table will do nothing, unless you delete the first message and some other message becomes the first in the list. Then that heading will be used. This is not my doing, this is the way ZOS wrote the gamepad notification system.
texture: The texture to be displayed. In keyboard mode it is 32 x 32.
shortDisplayText: Only used in gamepad mode. This is the text that is displayed under the category/heading, next to the texture, for your message. See gamepad picture for an example.
controlsOwnSounds: When false the game will automatically play the SOUNDS.ACCEPT, SOUNDS.DECLINE sounds when the buttons are clicked. When set to true no sounds will be played so that you can play your own click sounds.
The reason for separate keyboard/gamepad callbacks is because sometimes different code needs to be run for keyboard/gamepad mode. If your code can use the same callback for both just set the keyboard/gamepad callbacks to the same callback function.
keyboardAcceptCallback: Accept callback function for keyboard mode.
keyboardDeclineCallback: Decline callback function for keyboard mode.
gamepadAcceptCallback: Accept callback function for gamepad mode.
gamepadDeclineCallback: Decline callback function for gamepad mode.
data = {} There are other key/value pairs that are used by the game inside the message table. To avoid interfering with key names used by the game place any custom data you want to store with your message in this table.
Create your messages and add them to your provider notifications table:
It is up to you to add & remove your messages from the notifications table when you are done with them.Lua Code:
table.insert(provider.notifications, msg)
WARNING:
The table must be numerically indexed & there can be no missing indices. I recommend using table.insert() & table.remove() for adding/removing messages
After you are done making changes Adding/Removing messages, call the update function:
Lua Code:
provider:UpdateNotifications()Try not to call this anymore than necessary.
It fires off ALL of the BuildNotificationList functions for every notification provider in the game!
Just In case anyone needs to know for creating/selecting icons. The icon on the keyboard rowControl is 32 x 32.
The code can be found on github: https://github.com/sirinsidiator/ESO-LibNotification.
r10--
- removed LibStub support
- switched to semantic versioning
- updated for Secret of the Telvanni
r9--
- fixed incorrect string id for gamepad notification header (Thanks ZOSDanBatson!)
- updated for Markarth
r8--
- added LICENSE and put the code on github
r7--
- updated for Harrowstorm and Greymoor
- added a second global variable "LibNotification" to match the ingame addon name
r6--
- updated for Dragonhold
- made LibStub dependency optional (it's now recommended to use the LibNotifications global variable to access it)
- fixed typo in "keyboardDeclineCallback" (was "keybaordDeclineCallback" before. The incorrect spelling still works, but I recommend you fix it in your addons!)
- added IsLibrary flag to manifest
r5--
- updated for Murkmire
- switched to standalone package structure (developers: make sure you remove it from the manifest and change to DependsOn!)
- permanently fixed the errors that occur when ZOS adds new notification types (thanks Chip for making these tables global!)
r4--
- updated for Summerset
r3--
- updated for Morrowind
r2--
- updated for Homestead
Version 1.2--
- updated for Dark Brotherhood
- gamepad support seems to be broken and will be updated in a future version
Gamepad Support Added
WARNING: In order to add support for notifications in gamepad mode the entire library was rewritten. There have been some changes to the required structure of the message table. Please read the new instructions for creating a message table on the addons main page.
WARNING: To avoid errors if you wish to store extra data with your message store all of your custom data in a data table inside the message table. Read the new instructions for creating a message table on the addons main page.
File Name |
Version |
Size |
Uploader |
Date |
10 |
5kB |
sirinsidiator |
12/23/20 10:47 AM |
|
9 |
5kB |
sirinsidiator |
05/28/20 03:16 PM |
|
8 |
2kB |
sirinsidiator |
04/24/20 03:16 PM |
|
7 |
2kB |
sirinsidiator |
09/29/19 02:43 PM |
|
6 |
2kB |
sirinsidiator |
09/22/18 12:28 PM |
|
5 |
4kB |
sirinsidiator |
05/21/18 02:39 AM |
|
4 |
4kB |
sirinsidiator |
05/23/17 02:25 AM |
|
3 |
4kB |
sirinsidiator |
02/14/17 11:15 AM |
|
2 |
4kB |
sirinsidiator |
06/11/16 01:58 AM |
|
1.2 |
2kB |
circonian |
11/06/15 09:17 PM |
|
1.1 |
1kB |
circonian |
11/04/15 07:39 PM |
|
1.0 |
1kB |
circonian |
11/03/15 08:20 PM |
![]() |
Comment Options |
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
![]() |
|
Not working since last update. Getting annoying guild recruitment messages in chat every few minutes. Please update! This is one of the best addon's! I would be forever grateful! Thank you very much!
|
|
![]() |
![]() |
TairenSoul |
View Public Profile |
Send a private message to TairenSoul |
Send email to TairenSoul |
Find More Posts by TairenSoul |
Add TairenSoul to Your Buddy List |
![]() |
|
|
## IsLibrary: true
need to be added to the manifest of this one =) |
![]() |
![]() |
Marazota |
View Public Profile |
Send a private message to Marazota |
Send email to Marazota |
Find More Posts by Marazota |
Add Marazota to Your Buddy List |
![]() |
|
Any updates coming to this lib for Elsweyr with the new guild applications added?
|
|
![]() |
![]() |
SteveCampsOut |
View Public Profile |
Send a private message to SteveCampsOut |
Send email to SteveCampsOut |
Find More Posts by SteveCampsOut |
Add SteveCampsOut to Your Buddy List |
![]() |
|
Thanks for letting me know. The new version should permanently fix this issue. Just install it as regular addon and it should no longer happen.
|
|
![]() |
![]() |
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Send email to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
![]() |
||
|
just created a first new hero on EU server to do Summerset Pathfinder, you know
and got this ![]() more info
![]()
Last edited by Marazota : 09/20/18 at 12:04 PM.
|
|
![]() |
![]() |
Marazota |
View Public Profile |
Send a private message to Marazota |
Send email to Marazota |
Find More Posts by Marazota |
Add Marazota to Your Buddy List |
![]() |
||||
|
![]() ![]() |
|||
![]() |
![]() |
dorrino |
View Public Profile |
Send a private message to dorrino |
Send email to dorrino |
Find More Posts by dorrino |
Add dorrino to Your Buddy List |
![]() |
|||
![]() |
|||
![]() |
![]() |
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Send email to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
![]() |
||
|
![]() |
|
![]() |
![]() |
dorrino |
View Public Profile |
Send a private message to dorrino |
Send email to dorrino |
Find More Posts by dorrino |
Add dorrino to Your Buddy List |
![]() |
||
|
||
![]() |
![]() |
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Send email to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
![]() |
|
Forum posts: 40
File comments: 69
Uploads: 0
|
This library needs to be updated for update 2.4.
Seems to be an easy update with just the tables KEYBOARD_NOTIFICATION_ICONS, GAMEPAD_NOTIFICATION_ICONS, and DATA_TYPE_TO_TEMPLATE. They're defined as local variables in EsoUI/Ingame/Contacts/Keyboard/Notifications_keyboard.lua and /Gamepad/Notifications_gamepad.lua. |
![]() |
![]() |
Sounomi |
View Public Profile |
Send a private message to Sounomi |
Send email to Sounomi |
Find More Posts by Sounomi |
Add Sounomi to Your Buddy List |
![]() |
|
Thank you for this library, works like a charm. (Added to No Thank you to redirect Lua Errors to Notifications).
|
|
![]() |
![]() |
Ayantir |
View Public Profile |
Send a private message to Ayantir |
Send email to Ayantir |
Visit Ayantir's homepage! |
Find More Posts by Ayantir |
Add Ayantir to Your Buddy List |
![]() |
|||
![]() |
|||
![]() |
![]() |
CaptainBlagbird |
View Public Profile |
Send a private message to CaptainBlagbird |
Send email to CaptainBlagbird |
Visit CaptainBlagbird's homepage! |
Find More Posts by CaptainBlagbird |
Add CaptainBlagbird to Your Buddy List |
![]() |
||
|
![]() You said you "Removed a custom notification (#2)" and it is true that the notification with the heading Added #2 has disappeared, but I also notice that the message text associated with every notification has changed & no longer matches the heading. ONLY removing a notification would not change the heading/text of the other notifications so clearly something else has happened here. The sort problem does indeed exist, but something else is also going on in your test example. ![]() You are indeed correct about the MotD though, the fact that the sort key is missing from the MotD message table is what is messing up the entire sort. http://www.esoui.com/forums/showthread.php?p=24187#post24187 If you want to test it yourself, just add that key to the MotD BuildNotificationList function (dump this in your code file)
Warning: Spoiler
Lua Code:
and that will fix the sort problem. Hopefully they'll fix it though.
Last edited by circonian : 11/07/15 at 06:29 PM.
|
|
![]() |
![]() |
circonian |
View Public Profile |
Send a private message to circonian |
Send email to circonian |
Visit circonian's homepage! |
Find More Posts by circonian |
Add circonian to Your Buddy List |
![]() |
|||||
|
You are correct that they could have just checked if they were in gamepad mode & handled it all in a single accept/decline callback, but I guess they didn't want to have to do that so they created separate providers so that keyboard/gamepad mode would have unique callbacks. Which is also why I followed suit & added separate accept/decline callbacks for keyboard/gamepad mode. |
||||
![]() |
![]() |
circonian |
View Public Profile |
Send a private message to circonian |
Send email to circonian |
Visit circonian's homepage! |
Find More Posts by circonian |
Add circonian to Your Buddy List |
![]() |