Apparently PLAYER_LOGIN was just not late enough. It works, when I am using a timer to make sure that I am really the last.
Thanks again!!
Lua Code:
local folderName = ...
local L = LibStub("AceAddon-3.0"):NewAddon(folderName, "AceTimer-3.0")
local startupFrame = CreateFrame("Frame")
startupFrame:RegisterEvent("PLAYER_LOGIN")
startupFrame:SetScript("OnEvent", function(self, event, ...)
L:ScheduleTimer("initCode", 5.0)
end)
function L:initCode()
-- Save any previously registered scripts.
local oldscript=GameTooltip:GetScript("OnTooltipSetItem")
-- Futureproofing, support extra args to pass to previous scripts
GameTooltip:SetScript("OnTooltipSetItem", function(self, ...)
self:AddLine("I am first!")
if oldscript then return oldscript(self, ...) end
end);
end