For the achievement addon I'm developing, I'm hooking into some functions via:
Lua Code:
local orgLayoutAchievements = ACHIEVEMENTS.LayoutAchievements
function ACHIEVEMENTS:LayoutAchievements(achievements)
addon.achievementPool:ReleaseAllObjects()
ZO_ClearTable(self.achievementsById)
ZO_Scroll_ResetToTop(addon.contentList)
local previous
for i = 1, #achievements do
local id = achievements[i]
if ZO_ShouldShowAchievement(self.categoryFilter.filterType, id) then
local achievement = addon.achievementPool:AcquireObject()
local baseAchievementId = self:GetBaseAchievementId(id)
self.achievementsById[baseAchievementId] = achievement
-- i here is the same as the achievementIndex for the achievement
achievement:SetIndex(i)
achievement:Show(ZO_GetNextInProgressAchievementInLine(id))
achievement:SetAnchoredToAchievement(previous)
previous = achievement
end
end
orgLayoutAchievements(self, achievements)
end
If a second addon was to hook into this function, how would it behave? I'm assuming whichever one is loaded last becomes the defacto implementation. I initially used ZO_PreHook but for some reason switched to the method above for later hooks. Do both methods behave the same with a 2nd addon hooking into it?