That's true. Thanks for pointing it out.
In fact, it seems that the registered functions are executed in the order they have been registered. So it is not possible to make sure you are first by waiting with the registration.
Lua Code:
local startupFrame = CreateFrame("Frame")
startupFrame:RegisterEvent("PLAYER_LOGIN")
startupFrame:SetScript("OnEvent", function(self, event, ...)
TooltipDataProcessor.AddTooltipPreCall(Enum.TooltipDataType.Item, function(self)
print("Registered first.")
end)
C_Timer.After(3.0, function()
TooltipDataProcessor.AddTooltipPreCall(Enum.TooltipDataType.Item, function(self)
print("Registered after 3 seconds.")
end)
end)
C_Timer.After(5.0, function()
TooltipDataProcessor.AddTooltipPreCall(Enum.TooltipDataType.Item, function(self)
print("Registered after 5 seconds.")
end)
end)
end)
Printed result is:
Registered first.
Registered after 3 seconds.
Registered after 5 seconds.