Quantcast WoWInterface - View Single Post - ACE3 - reusing addon table from other addon
View Single Post
01-28-18, 04:19 PM   #1
A Murloc Raider
Join Date: Aug 2012
Posts: 5
ACE3 - reusing addon table from other addon

I was wondering if it was possible to access an addon's addon-table from within a different addon.

So basically I have two addons (2nd addon depends on 1st addon):
(dont mind the names, I changed them to illustrate my problem better)

local addonName1, addonTable1 = ...
local addon1 = LibStub("AceAddon-3.0"):NewAddon(addonName1)

addonTable1 = { --bunch of data }
local addonName2, addonTable2 = ...
local addon1 = LibStub("AceAddon-3.0"):GetAddon("addon1", true)
if not addon1 then return end
local addon2 = addon1:NewModule(addonName2)
So how could I access addonTable1?
I could wrap the variable in a function and have it return that specific table to me in addon2, but I was wondering if there was a more clever way of doing this.
Perhaps ace3 provides a clever way?
  Reply With Quote