Oh, yeah your right it is local.
No I hadn't looked at it, but I see you were all ready doing what I suggested.
Looks like it would work to me. Although I think you could get rid of one of the loops by doing this:
Warning: Spoiler
Lua Code:
function TI.HookNotifications()
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
-- Change this:
-- table.insert(guildMembers, displayName)
-- To something like this:
table.insert(guildMembers, {["NAME"] = displayName, ["MEMBERINDEX"] = memberIndex})
end
end
-- change this:
--for _, name in ipairs(guildMembers) do
-- To this, because were now getting a table:
for _, tPlayerInfo 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)
-- And I think you could then avoid doing this loop:
--for memberIndex = 1, GetNumGuildMembers(guildId) do
-- change this:
--local displayName = GetGuildMemberInfo(guildId, memberIndex)
-- to this:
local displayName = GetGuildMemberInfo(guildId, tPlayerInfo["MEMBERINDEX"])
-- and last change this:
--if displayName == name then
-- to this:
if displayName == tPlayerInfo["NAME"] then
--d(zo_strformat("RL notify hit: <<1>> from <<2>>", displayName, GetGuildName(guildId)))
showNotification = true
break
end
--end
end
end
end
if not showNotification then
--d(zo_strformat("Removed RL notification! (i: <<1>>, id: <<2>>)", index, notificationId))
RemoveRaidScoreNotification(notificationId)
end
end
end)
end
EDIT:
Or I may have spoke to soon. I've never done any pvp/raid stuff. I have no idea how any of it even works. I may be wrong about what I said above...I thought this memberIndex:
Lua Code:
local numMembers = GetNumRaidScoreNotificationMembers(notificationId)
local hasFriend = false
local hasGuildMember = false
for memberIndex = 1, numMembers do
local displayName, characterName, isFriend, isGuildMember = GetRaidScoreNotificationMemberInfo(notificationId, memberIndex)
was refering to the same memberIndex used for a guild members index,
Lua Code:
local displayName = GetGuildMemberInfo(guildId, memberIndex)
but I read it again and think they might not be the same? Does the first one refer to memberIndex as the "memberIndex" for members of a raid party (people involved in that notification)? If so what I said would not work.