+ Reply to Thread
Results 1 to 4 of 4

  Click here to go to the first Rift Team post in this thread.   Thread: Load, enable, disable addons

  1. #1
    Champion Lorandii's Avatar
    Join Date
    Jun 2011
    Posts
    516

    Default Load, enable, disable addons

    There is no APIs for loading or unloading addons in game yet, but I am wondering if that something to be eventually implemented. On that track, we can check if an addon exists using _G or Inspect.Addon.List.

    But what about enabling or disabling addons while the game is running, preferably without a ReloadUI? Most of what is going is Event-driven, and they are table.insert-created to process. I'm asking about either a way to unhook a single event or all events at the same time.

    I suppose you could loop table.remove, but I'm not sure what the code would be in order to get it specific to an individual addon. More complicated, what if AddonA wants AddonB to stop running? What about AddonA checking its own, or AddonB's enabled state at Event.Addon.Load.Begin and setting the state accordingly as per saved variables?

    This comes down to using a toggle in user preferences. On, and everything works. Turn it off, and the addon stops processing events, flashing screen, or whatever. On again, and back to normal. ReloadUI, logging out, and full exit only save the state of the on/off variable.

  2.   Click here to go to the next Rift Team post in this thread.   #2
    Rift Team
    Join Date
    Oct 2010
    Posts
    927

    Default

    Quote Originally Posted by Lorandii View Post
    There is no APIs for loading or unloading addons in game yet, but I am wondering if that something to be eventually implemented. On that track, we can check if an addon exists using _G or Inspect.Addon.List.
    A few answers here:

    For quite some time now I've wanted to rig things up so the addon manager is usable without logging out. It was originally designed to work this way, I just haven't had time to implement it. However, changing addons will result in a reloadui.

    Loading extra addons at runtime isn't too conceptually difficult, and will probably show up eventually, along with the hooks needed to make an "addon manager addon". Likely it'll also be associated with features that give addons a bit more control over their environment, possibly (no guarantees, as always) things like "load this file out of my addon directory". Which should make database addons much more efficient and easier to design.

    Unloading addons at runtime is a royal knot. This will be an addon-by-addon thing - if an author wants to write that feature and provide buttons to use it, they're welcome to, but we won't be providing much assistance.

  3. #3
    Champion Lorandii's Avatar
    Join Date
    Jun 2011
    Posts
    516

    Default

    Quote Originally Posted by ZorbaTHut View Post
    A few answers here:

    For quite some time now I've wanted to rig things up so the addon manager is usable without logging out. It was originally designed to work this way, I just haven't had time to implement it. However, changing addons will result in a reloadui.
    Having an addon manager force a reloadui isn't bad, and is expected, since that's how they worked in WoW. Enable, disable via the manager, and reloadui. Not a big deal.
    Quote Originally Posted by ZorbaTHut View Post
    Loading extra addons at runtime isn't too conceptually difficult, and will probably show up eventually, along with the hooks needed to make an "addon manager addon". Likely it'll also be associated with features that give addons a bit more control over their environment, possibly (no guarantees, as always) things like "load this file out of my addon directory". Which should make database addons much more efficient and easier to design.
    Sounds about right to me.
    Quote Originally Posted by ZorbaTHut View Post
    Unloading addons at runtime is a royal knot. This will be an addon-by-addon thing - if an author wants to write that feature and provide buttons to use it, they're welcome to, but we won't be providing much assistance.
    That can be done. Now I just have to figure out how to code table.remove to remove the elements specific to each addon. And then table.remove Event.* specific to each addon. Don't want to mess with any addon but your own.

  4.   This is the last Rift Team post in this thread.   #4
    Rift Team
    Join Date
    Oct 2010
    Posts
    927

    Default

    Quote Originally Posted by Lorandii View Post
    That can be done. Now I just have to figure out how to code table.remove to remove the elements specific to each addon. And then table.remove Event.* specific to each addon. Don't want to mess with any addon but your own.
    For what it's worth, manipulations like this are why the event tables require each event to include an addon name Shouldn't be too difficult.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts