Commit 0127598c authored by Blazeflack's avatar Blazeflack

Fixed error caused by attempt to update ElvUI bags too early

This fixes #2
parent 84024d91
local E = unpack(ElvUI)
local B = E:GetModule("Bags")
local ElvUIBags = ElvUI[1]:GetModule("Bags")
--Update Icon on bag slot
local function UpdateSlot(self, bagID, slotID)
......@@ -22,13 +21,20 @@ local function UpdateSlot(self, bagID, slotID)
end
end
end
hooksecurefunc(B, "UpdateSlot", UpdateSlot)
hooksecurefunc(ElvUIBags, "UpdateSlot", UpdateSlot)
-- Update Bags
-- Function we can call to update all bag slots
local function UpdateBags()
B:UpdateAllBagSlots()
ElvUIBags:UpdateAllBagSlots()
end
hooksecurefunc(Scrap, 'SettingsUpdated', UpdateBags)
hooksecurefunc(Scrap, 'ToggleJunk', UpdateBags)
Scrap.HasSpotlight = true
\ No newline at end of file
-- Set Hooks
local function SetHooks()
hooksecurefunc(Scrap, 'SettingsUpdated', UpdateBags)
hooksecurefunc(Scrap, 'ToggleJunk', UpdateBags)
UpdateBags()
Scrap.HasSpotlight = true
end
hooksecurefunc(ElvUIBags, "Initialize", SetHooks)
\ No newline at end of file
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