Conversation
grabthar
commented
Aug 15, 2022
- support for multiple file addons
- support (client) ability to include other file in the same addon
- support for multiple file addons - support (client) ability to include other file in the same addon
|
nice job |
|
Hmm. There is no multi file addon support added other than the namespaces? The addon namespaces seems to be something that one can create already by doing I guess this adds some convenience, but not quite sure its worth sacrificing backwards compatibility. Maybe it could be done differently while achieving the same results. For example, maybe the namespace does not need to be defined by the system. -- AIO.lua
function AIO.Namespace(ns_name, addon_name, aio_ns_table)
aio_ns_table[ns_name] = aio_ns_table[ns_name] or {}
return addon_name, aio_ns_table[ns_name]
end
-- client.lua
local AIO = AIO or require("AIO")
-- the ... dots are addon_name, aio_ns_table passed in by RunAddon
local name, namespace = AIO.Namespace("MyAddon", ...) |
This is not the same thing, MyAddon is a global while here the namespace I use is the "AIO" addonnamespace, other addons non AIO won't be able to use this ns. -- the ... dots are addon_name, aio_ns_table passed in by RunAddon
local name, namespace = AIO.Namespace("MyAddon", ...)This is not the standard syntax wich is: -- the ... dots are addon_name, aio_ns_table passed in by RunAddon
local name, namespace = ...With my solution you could for example parse a toc file to send a real addon because the client syntax is preserved. I think there's many pro/cons and many way to achieve this. I did my best to improve AIO, the choice to merge or not is up to you! I also worked on a backport solution but this is not great, https://github.com/grabthar/ElunaAioScripts |