View Single Post
08/21/14, 07:51 PM   #11
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by circonian View Post
...
I'd like to hook ZO_LeaderboardRaidProvider but it's local to EsoUI\Ingame\Contacts\Notifications.lua.
Lua Code:
  1. local ZO_LeaderboardRaidProvider = ZO_NotificationProvider:Subclass()
That's why I have hooked NOTIFICATIONS.providers[10]:BuildNotificationList() instead.

By the way did you check code in modified Thurisaz Guild Info which I have linked above?

Lua Code:
  1. ZO_PreHook(NOTIFICATIONS.providers[10], "BuildNotificationList", function(self)
  2.     for index = 1, GetNumRaidScoreNotifications() do
  3.         local notificationId = GetRaidScoreNotificationId(index)
  4.         local numMembers = GetNumRaidScoreNotificationMembers(notificationId)
  5.         local showNotification = false
  6.         local guildMembers = {}
  7.         for memberIndex = 1, numMembers do
  8.             local displayName, _, _, isGuildMember = GetRaidScoreNotificationMemberInfo(notificationId, memberIndex)
  9.             if isGuildMember then
  10.                 table.insert(guildMembers, displayName)
  11.             end
  12.         end
  13.         for _, name in ipairs(guildMembers) do
  14.             for guildIndex = 1, GetNumGuilds() do
  15.                 if not showNotification and TI.GetGuildSetting(guildIndex) and TI.GetRaidScoreNotifySetting(guildIndex) then
  16.                     local guildId = GetGuildId(guildIndex)
  17.                     for memberIndex = 1, GetNumGuildMembers(guildId) do
  18.                         local displayName = GetGuildMemberInfo(guildId, memberIndex)
  19.                         if displayName == name then
  20.                             showNotification = true
  21.                             break
  22.                         end
  23.                     end
  24.                 end
  25.             end
  26.         end
  27.         if not showNotification then
  28.             RemoveRaidScoreNotification(notificationId)
  29.         end
  30.     end
  31. end)
  Reply With Quote