View Single Post
12/16/14, 04:05 PM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
What is happening:
  1. Lets trigger any notification event, other then raid score. For example EVENT_CAMPAIGN_QUEUE_JOINED:
    Lua Code:
    1. EVENT_MANAGER:RegisterForEvent(self.notificationManager.eventNamespace, event, self.pushUpdateCallback)
    translated to global reference it is:
    Lua Code:
    1. EVENT_MANAGER:RegisterForEvent("KeyboardNotifications", EVENT_CAMPAIGN_QUEUE_JOINED, NOTIFICATIONS.providers[3].pushUpdateCallback)
  2. NOTIFICATIONS.providers[3].pushUpdateCallback
    Lua Code:
    1. provider.pushUpdateCallback = function()
    2.     provider:PushUpdateToNotificationManager()
    3. end
  3. NOTIFICATIONS.providers[3]:PushUpdateToNotificationManager()
    Lua Code:
    1. function ZO_NotificationProvider:PushUpdateToNotificationManager()
    2.     self:BuildNotificationList()
    3.     self.notificationManager:RefreshNotificationList()
    4. end
  4. NOTIFICATIONS.providers[3].notificationManager:RefreshNotificationList() == NOTIFICATIONS:RefreshNotificationList()
    Lua Code:
    1. function ZO_NotificationManager:RefreshNotificationList()
    2.     self:ClearNotificationList()
    3.     self:BuildNotificationList()
    4.     self:FinishNotificationList()
    5. end
  5. NOTIFICATIONS:BuildNotificationList()
    Lua Code:
    1. function ZO_NotificationManager:BuildNotificationList()
    2.     for i = 1, #self.providers do
    3.         self.providers[i]:BuildNotificationList()
    4.     end
    5.  
    6.     --rest of the original code
    7.  
    8. end
  6. NOTIFICATIONS.providers[10]:BuildNotificationList() - NOTIFICATIONS.providers[10] is an instance of ZO_KeyboardLeaderboardRaidProvider

As you can see raid score notification will be eventually added to the list even if you unregister update events.
  Reply With Quote