Verified Commit 206fdfb2 authored by Repooc's avatar Repooc
Browse files

clean up and fixed an issue

parent d943d62f
......@@ -2,24 +2,21 @@ local SLE, T, E, L, V, P, G = unpack(select(2, ...))
local DB = SLE:GetModule('DataBars')
local EDB = E:GetModule('DataBars')
--Cache global variables
--Lua functions
local floor = floor
local format = string.format
--WoW API / Variables
local floor, format = floor, string.format
local C_AzeriteItem_GetAzeriteItemXPInfo = C_AzeriteItem.GetAzeriteItemXPInfo
local C_AzeriteItem_GetPowerLevel = C_AzeriteItem.GetPowerLevel
local C_AzeriteItem_FindActiveAzeriteItem = C_AzeriteItem.FindActiveAzeriteItem
local function AzeriteBar_Update(self, event, unit)
if not E.db.sle.databars.azerite.longtext then return end
if not DB.db.azerite.longtext then return end
if (event == 'UNIT_INVENTORY_CHANGED' and unit ~= 'player') then
return
end
local bar = EDB.StatusBars.Azerite
local azeriteItemLocation = C_AzeriteItem_FindActiveAzeriteItem()
if azeriteItemLocation and (not self.db.azerite.hideInCombat or not InCombatLockdown()) then
if azeriteItemLocation and (not E.db.databars.azerite.hideInCombat or not InCombatLockdown()) then
local text = ''
local xp, totalLevelXP = C_AzeriteItem_GetAzeriteItemXPInfo(azeriteItemLocation)
local xpToNextLevel = totalLevelXP - xp
......@@ -49,4 +46,4 @@ end
function DB:AzeriteInit()
-- DB:PopulateExpPatterns()
hooksecurefunc(EDB, 'AzeriteBar_Update', AzeriteBar_Update)
end
\ No newline at end of file
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment