From 6b3a7c1da072377a8bd72b7478907cef0531c287 Mon Sep 17 00:00:00 2001 From: DJSchaffner Date: Wed, 21 Feb 2024 17:57:15 +0100 Subject: [PATCH] added itemrack as dependency again - this time it works --- BetterBags_ItemRack.toc | 2 +- main.lua | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) 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