This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [QUESTION] Changing AddOn to a FrameXML module  (Read 1039 times)

saifi0102

  • Registred Member
  • LUA Script Tinker
  • *****
  • Posts: 42
    • View Profile
[QUESTION] Changing AddOn to a FrameXML module
« 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?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [QUESTION] Changing AddOn to a FrameXML module
« Reply #1 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

saifi0102

  • Registred Member
  • LUA Script Tinker
  • *****
  • Posts: 42
    • View Profile
Re: [QUESTION] Changing AddOn to a FrameXML module
« Reply #2 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
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

saifi0102

  • Registred Member
  • LUA Script Tinker
  • *****
  • Posts: 42
    • View Profile
Re: [QUESTION] Changing AddOn to a FrameXML module
« Reply #3 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?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

saifi0102

  • Registred Member
  • LUA Script Tinker
  • *****
  • Posts: 42
    • View Profile
Re: [QUESTION] Changing AddOn to a FrameXML module
« Reply #4 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [QUESTION] Changing AddOn to a FrameXML module
« Reply #5 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
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

saifi0102

  • Registred Member
  • LUA Script Tinker
  • *****
  • Posts: 42
    • View Profile
Re: [QUESTION] Changing AddOn to a FrameXML module
« Reply #6 on: August 14, 2015, 08:13:31 pm »
Thanks
« Last Edit: January 01, 1970, 01:00:00 am by Admin »