diff --git a/BetterBags_ItemRack.toc b/BetterBags_ItemRack.toc index 83e546c..f56307a 100644 --- a/BetterBags_ItemRack.toc +++ b/BetterBags_ItemRack.toc @@ -3,6 +3,6 @@ ## Notes: Add a category to BetterBags for ItemRack sets ## Author: DJSchaffner ## Version: @1.3.0 -## Dependencies: BetterBags +## Dependencies: BetterBags, ItemRack main.lua diff --git a/main.lua b/main.lua index 93528ca..64d30db 100644 --- a/main.lua +++ b/main.lua @@ -7,7 +7,9 @@ local L = addonBetterBags:GetModule('Localization') local debug = false local frame = CreateFrame("Frame", nil) + ------------------------------------------------------- + local function printChat(message) if debug == true then print("[BetterBags ItemRack] ".. tostring(message)) @@ -92,13 +94,11 @@ local function itemRackUpdated(event, eventData) printChat(event) updateCategories() end + ------------------------------------------------------- -frame:RegisterEvent("ADDON_LOADED") -frame:SetScript("OnEvent", function(self, event, addon, ...) - if event == "ADDON_LOADED" and addon == "ItemRack" then + +-- Don't listen for load event since it should be loaded already (dependency) ItemRack:RegisterExternalEventListener("ITEMRACK_SET_SAVED", itemRackUpdated) ItemRack:RegisterExternalEventListener("ITEMRACK_SET_DELETED", itemRackUpdated) - initCategories() - end -end) \ No newline at end of file + initCategories() \ No newline at end of file