View Single Post
12-20-17, 05:48 AM   #15
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
@Ammako

Originally Posted by Ammako View Post
Edit: Actually, if you want to think out of the box. You can probably have a separate addon bundled with your actual addon, whose only job is to load the addon itself if the character being played is a rogue.
If that works for addons that are bundled with external libraries, at least.

Something like this:

See if that works, or if that causes issues. All that would be in MyAddonLoader is the .toc and the basic class check test in the .lua, the libraries and everything would be in MyAddon and should only be loaded if the character being played is a rogue?
If that doesn't work, then I guess prompting the user to /reload or having them deal with the addon being loaded once during first login would be the only real solution.
Actually, this was the second solution that I thought after reading jeruku, Seerah and your replies

This definitely worked as I expected, but the reason that I abandoned this, at first, was because I felt it was contradictory to waste a resource by creating another addon to reduce the resource waste of the main addon.

BUT, I did miss a point that I had libraries and media embedded into my addon and thus, creating a separate addon like that would still be much better than those unnecessary libraries and media being loaded

Originally Posted by Ammako View Post
Also it looks like you may also have to add the included library dependencies to MyAddon.toc, but I'm not sure which ones you are using or which ones you need (and tbh I've never toyed with that), so you'll have to keep in mind to add that yourself.
Yeap, I've already stated those OptionalDeps to my TOC

Last edited by Layback_ : 12-20-17 at 06:02 AM.
  Reply With Quote