Well, for better or worse this is what I have working, with one caveat. Any tips to clean up the code is appreciated. I left the uncommented stuff in for now.
Code:
local azerite_update = function(self)
local azeriteItemLocation = C_AzeriteItem.FindActiveAzeriteItem()
--if C_AzeriteItem.HasActiveAzeriteItem() then
if azeriteItemLocation then
--local azeriteItem = Item:CreateFromItemLocation(azeriteItemLocation);
--local azeriteItemName = azeriteItem:GetItemName()
local xp, totalLevelXP = C_AzeriteItem.GetAzeriteItemXPInfo(azeriteItemLocation)
local currentLevel = C_AzeriteItem.GetPowerLevel(azeriteItemLocation)
local xpToNextLevel = totalLevelXP - xp
if not azerite:IsShown() then
azerite:Show()
end
azerite:SetAnimatedValues(xp, 0, totalLevelXP)
-- azerite:SetMinMaxValues(0, totalLevelXP)
-- azerite:SetValue(xp)
-- azerite:Show()
-- local y
-- if UnitLevel'player' < MAX_PLAYER_LEVEL or faction then
-- y = POSITION[5] + OFFSET
-- else
-- y = POSITION[5]
-- end
--
-- azerite:SetPoint(POSITION[1], POSITION[2], POSITION[3], POSITION[4], y)
else
if azerite:IsShown() then
azerite:Hide()
end
end
if event == 'AZERITE_ITEM_EXPERIENCE_CHANGED' or event == 'PLAYER_ENTERING_WORLD' then
if not azerite:IsShown() then
azerite:Show()
end
end
end
The caveat. The azerite tooltip that should show when you mouseover the azerite bar gives this error:
Code:
30x modules/exp.lua:255: bad argument #1 to 'format' (string expected, got nil)
[C]: in function `format'
modules/exp.lua:255: in function <modules/exp.lua:248>
modules/exp.lua:280: in function <modules/exp.lua:280>
Locals:
(*temporary) = "Level %s (%s Artifact Power to next level)"
(*temporary) = nil
(*temporary) = nil
(*temporary) = "string expected, got nil"