local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("Broker_ItemRack", {type = "data source", label = "Broker ItemRack", icon = "Interface\\Addons\\Broker_ItemRack\\Broker_ItemRack", text = L["<no outfit>"]}) |
local BRItemRack = CreateFrame("Frame", "Broker_ItemRack") |
|
BRItemRack:RegisterEvent("VARIABLES_LOADED") |
BRItemRack:RegisterEvent("PLAYER_ENTERING_WORLD"); |
BRItemRack:RegisterEvent("UNIT_INVENTORY_CHANGED"); |
BRItemRack:RegisterEvent("ADDON_LOADED") |
|
BRItemRack:SetScript("OnEvent", function(self, event, arg1, ...) |
|
if event == "ADDON_LOADED" then |
if IsAddOnLoaded("ItemRackOptions") then |
if event == "ADDON_LOADED" and arg1 == "ItemRackOptions" then |
hooksecurefunc(ItemRackOpt, "SaveSet", BRItemRack_Update) |
BRItemRack:UnregisterEvent("ADDON_LOADED") |
end |
if IsAddOnLoaded("Broker_ItemRack") then BRItemRack:UnregisterEvent("ADDON_LOADED") end |
end |
|
if event == "VARIABLES_LOADED" then |
|
if event == "ADDON_LOADED" and arg1 == "Broker_ItemRack" then |
if not Broker_ItemRackConfig then |
-- initialize default configuration |
Broker_ItemRackConfig = { |
MenuOrientation = "VERTICAL" |
} |
end |
|
end |
-- set enable events to whatever value ItemRack assigns |
Broker_ItemRackConfig.EnableEvents = ItemRackUser.EnableEvents or "ON" |
|
end |
|
if ((event == "UNIT_INVENTORY_CHANGED") and (arg1 == "player")) or event == "PLAYER_ENTERING_WORLD" then |