Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Miscellaneous => Topic started by: saifi0102 on August 14, 2015, 01:04:20 pm

Title: [QUESTION] Changing AddOn to a FrameXML module
Post by: saifi0102 on August 14, 2015, 01:04:20 pm
Hey,

I'm trying to move the AIO addon to FrameXML. There are 2 things that are bugging me, the event "ADDON_LOADED" does not fire since its no longer an addon. And the other is the saving/loading saved variables.

Can any one please tell me what I should do to handle loading the module after saved variables are loaded like in a normal addon?
Title: Re: [QUESTION] Changing AddOn to a FrameXML module
Post by: stoneharry on August 14, 2015, 01:24:35 pm
Quote from: "saifi0102"
Hey,

I'm trying to move the AIO addon to FrameXML. There are 2 things that are bugging me, the event "ADDON_LOADED" does not fire since its no longer an addon. And the other is the saving/loading saved variables.

Can any one please tell me what I should do to handle loading the module after saved variables are loaded like in a normal addon?

You can't, as far as I know. You would need to hide the data in CVAR data. The FrameXML does not behave the same as an addon.

You could just use an addon then hide that addon from the addon list like the Blizzard addons.
Title: Re: [QUESTION] Changing AddOn to a FrameXML module
Post by: saifi0102 on August 14, 2015, 01:44:36 pm
I thought about that too... But the problem with that is that AIO won't be loaded when FrameXML is loading so registering AIO handlers would require a few additional instruction.

Anyway, I'm gonna try if saved variables work in FrameXML.toc
Title: Re: [QUESTION] Changing AddOn to a FrameXML module
Post by: saifi0102 on August 14, 2015, 02:30:48 pm
Ok I made AIO a load on demand addon and a loaded the addon from FrameXML.toc -> AIOLoader.lua -> LoadAddOn("AIO_Client"), however now ADDON_LOADED isn't firing. Any idea?
Title: Re: [QUESTION] Changing AddOn to a FrameXML module
Post by: saifi0102 on August 14, 2015, 02:53:25 pm
Used PLAYER_LOGIN for initializing AIO and saved variables are also working fine. Btw do you know how I can make the addon secure so that it doesn't show in AddOns list before logging in.

I entered #secure 1 in AIO_Client.toc but it crashed WoW saying FrameXML is corrupted even though I have the the checks disabled.
Title: Re: [QUESTION] Changing AddOn to a FrameXML module
Post by: stoneharry on August 14, 2015, 04:33:50 pm
Quote from: "saifi0102"
Used PLAYER_LOGIN for initializing AIO and saved variables are also working fine. Btw do you know how I can make the addon secure so that it doesn't show in AddOns list before logging in.

I entered #secure 1 in AIO_Client.toc but it crashed WoW saying FrameXML is corrupted even though I have the the checks disabled.

function AddonList_Update()

GlueXML/AddonList.lua

name, title, notes, url, loadable, reason, security, newVersion = GetAddOnInfo(addonIndex);
...
entry:Show();

to

if (name == "My Addon") then
entry:Hide()
end

etc
Title: Re: [QUESTION] Changing AddOn to a FrameXML module
Post by: saifi0102 on August 14, 2015, 08:13:31 pm
Thanks