Hi all,
I have coded to show in a LDB the artifact power instead the max level to accomplish this:
http://www.wowinterface.com/download....html#comments
Lua Code:
local frame = CreateFrame("Frame")
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
frame:RegisterEvent("PLAYER_XP_UPDATE")
frame:RegisterEvent("ARTIFACT_XP_UPDATE")
-- frame:RegisterEvent("PLAYER_EQUIPMENT_CHANGED")
frame:SetScript("OnEvent", function(self, event, ...)
if UnitLevel("player") == GetMaxPlayerLevel() then
if HasArtifactEquipped() then
local ArtPower, ArtPointsSpent= select(5,C_ArtifactUI.GetEquippedArtifactInfo());
dataobj.text = string_format("A:%s %.1f%%", ArtPointsSpent, ArtPower/C_ArtifactUI.GetCostForPointAtRank(ArtPointsSpent)*100)
else
dataobj.text = "L: " .. UnitLevel("player")
end
else
dataobj.text = string_format("L:%s %.1f%%", UnitLevel("player"), UnitXP("player")/UnitXPMax("player")*100)
end
end)
The problem is that if I don't use the:
Lua Code:
frame:RegisterEvent("PLAYER_EQUIPMENT_CHANGED")
on the first login it doesn't trigger
and so show only the level 110 info.
If I do /reload everything is fine ...
If I register also PLAYER_EQUIPMENT_CHANGED it works but I like to not add unnecessary events.
So the question is
...
Is possible that on PLAYER_ENTERING_WORLD I don't have yet the information about the equipped items ?
Is there a more specific event than PLAYER_EQUIPMENT_CHANGED that I can register to check this ?
Thanks to you all for the always precious help.