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) Code:
local addonName1, addonTable1 = ... Code:
local addonName2, addonTable2 = ... 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? |
Afaik, the only way that you could access another addon's namespace is by globalizing it.
Addon1 Lua Code:
Addon2 Lua Code:
|
For more clarification, the vararg ... is passed to every .lua file upon loading in WoW. It is a Blizzard implementation and is unique to every .toc file, so anything loaded by a single .toc file gets the same two arguments, the name of the .toc file and a table. Every file loaded after the first one gets the same table and any changes made to that table.
There is no way to access that vararg from another addon. If you're doing something personal, you can just alter that addon's code to allow you to access it or just change the relevant code. If these are your addons, Engavi has a valid method. |
The vararg method works well, but since you asked about Ace3, here's how to do it using that way.
Lua Code:
For example (I haven't looked at the code to make certain, I'm just theorizing) let's say you want to write a module for HandyNotes. Lua Code:
|
All times are GMT -6. The time now is 06:29 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI