Originally Posted by circonian
...
|
I'd like to hook ZO_LeaderboardRaidProvider but it's local to EsoUI\Ingame\Contacts\Notifications.lua.
Lua Code:
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:
ZO_PreHook(NOTIFICATIONS.providers[10], "BuildNotificationList", function(self)
for index = 1, GetNumRaidScoreNotifications() do
local notificationId = GetRaidScoreNotificationId(index)
local numMembers = GetNumRaidScoreNotificationMembers(notificationId)
local showNotification = false
local guildMembers = {}
for memberIndex = 1, numMembers do
local displayName, _, _, isGuildMember = GetRaidScoreNotificationMemberInfo(notificationId, memberIndex)
if isGuildMember then
table.insert(guildMembers, displayName)
end
end
for _, name in ipairs(guildMembers) do
for guildIndex = 1, GetNumGuilds() do
if not showNotification and TI.GetGuildSetting(guildIndex) and TI.GetRaidScoreNotifySetting(guildIndex) then
local guildId = GetGuildId(guildIndex)
for memberIndex = 1, GetNumGuildMembers(guildId) do
local displayName = GetGuildMemberInfo(guildId, memberIndex)
if displayName == name then
showNotification = true
break
end
end
end
end
end
if not showNotification then
RemoveRaidScoreNotification(notificationId)
end
end
end)