Commit 14f857ee authored by Blazeflack's avatar Blazeflack

Fixed error trying to hook non-existent function SettingsUpdated

This fixes #2
parent 4333612c
local ElvUIBags = ElvUI[1]:GetModule("Bags")
local ElvUISkins = ElvUI[1]:GetModule("Skins")
local E = unpack(ElvUI)
--Update Icon on bag slot
local function UpdateSlot(self, bagID, slotID)
......@@ -30,11 +32,44 @@ end
-- Set Hooks
local function SetHooks()
hooksecurefunc(Scrap, 'SettingsUpdated', UpdateBags)
hooksecurefunc(Scrap, 'VARIABLES_LOADED', UpdateBags)
hooksecurefunc(Scrap, 'ToggleJunk', UpdateBags)
UpdateBags()
Scrap.HasSpotlight = true
end
hooksecurefunc(ElvUIBags, "Initialize", SetHooks)
\ No newline at end of file
hooksecurefunc(ElvUIBags, "Initialize", SetHooks)
--Re-add JunkIcon on bag slots for the ElvUI Bags skin
local function CreateIcon(slot)
local icon = slot:CreateTexture(nil, 'OVERLAY', 7)
icon:SetTexture('Interface\\Buttons\\UI-GroupLoot-Coin-Up')
icon:SetPoint('TOPLEFT', 2, -2)
icon:SetSize(15, 15)
slot.scrapIcon = icon
return icon
end
local function SkinBags()
if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.bags ~= true or E.private.bags.enable then return end
for i=1, NUM_CONTAINER_FRAMES, 1 do
local container = _G["ContainerFrame"..i]
if container then
container:HookScript("OnShow", function(self)
if self and self.size then
for b=1, self.size, 1 do
local button = _G[self:GetName().."Item"..b]
if button.scrapIcon and button.scrapIcon:GetTexture() == nil then
button.scrapIcon:SetTexture('Interface\\Buttons\\UI-GroupLoot-Coin-Up')
end
end
end
end)
end
end
end
ElvUISkins:AddCallback("ElvUI_Scrap SkinBags", SkinBags)
\ No newline at end of file
## Interface: 70200
## Interface: 80000
## Title: |cff1784d1ElvUI|r Scrap
## Notes: Adds the junk icon on ElvUI bagslot items which are considered junk by Scrap.
## Author: Blazeflack
......
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