WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Load addon from 1 toc (https://www.wowinterface.com/forums/showthread.php?t=34877)

Nobgul 09-09-10 03:34 PM

Load addon from 1 toc
 
I was wondering if it was poissiable to load addon's from 1 toc.
What I mean is, I have a hunter, druid, and shaman. I have addons that I use for each but not for all 3. So could I call all the addons for a specific toon from 1 toc.


Example

c:\WoW\Interface\Addons\Shaman\
Shaman.toc

## Interface: 40000
## Title: Shaman Addons
## Notes: blah blahI

addons\Skinner\Skinner.toc
addons\Skinner\skinner.lua
addons\DBM\core.lua
addons\DBM\frame.lua
addons\DBM\DBM.toc



If you see what I mean create 1 folder with all the addons contained in them and then call the addons from 1 toc file.

Then when i logged in if i hit the addons button i would see 3 options
Shaman
Hunter
Druid

And i could just enable the proper "set"

sacrife 09-09-10 04:06 PM

Yes that would work. however with addons such as oUF that requires it's core to work you need to embed it properly.

And props on a good idea :)

Nobgul 09-09-10 04:29 PM

Thanks. Gonna Work on it tonight. Im just thinking saved vars may be a issue.

sacrife 09-09-10 04:38 PM

As long as you include the savedvariables needed to be saved (copy from the original toc's) you should be fine.

Phanx 09-09-10 05:00 PM

Why do you need this? If you want to load addons A and B on character X, but addons B and C on character Y, and addons A and C on character Z, just hit "Disable All" at the addons screen, then select each character from the dropdown at the top, and selectively enable the addons you want for that character. Using the default methods to enable different addons on different characters is (a) faster, (b) less work because it doesn't require copying and pasting, or deleting and creating files, and (c) easier to update in the future if you decide character X needs addon C after all, or if you install a new addon.

That aside, calling one addon's TOC from another addon's TOC does nothing. WoW just ignores it. You'd need to copy ALL of the file listings from the original TOC and paste them in yours, as well as merge in all of the saved variables lines.

Another issue you'd likely run into is that addons written (or updated) for WoW 3.3 often make use of the addon namespacing feature added in that patch, and are likely to use generic names in their namespace, expecting it to be private to their addon as they wrote it. For example, "db" or "L". Unless you modified the addons to rename these namespace values, you'd encounter errors as one addon's value overwrote another.

Finally, you'd only be able to use this setup for yourself, as copyright and license terms would prohibit you from distributing a "single addon" version of multiple addons, unless they were all licensed under identical terms which allowed such distribution (eg. the GPL).

Nobgul 09-10-10 05:44 AM

Thank You for the info Phanx,

I figured it would be a bear of a task for me to do, I wasn't 100% sure if it was something i wanted to do anyway. If i do decide to take the time to do it I would never " Release it to the public" Although all the addons I do use I already have the original author's consent to redistribute.

break19 09-10-10 06:08 AM

Quote:

Originally Posted by nobgul (Post 205694)
Thank You for the info Phanx,

I figured it would be a bear of a task for me to do, I wasn't 100% sure if it was something i wanted to do anyway. If i do decide to take the time to do it I would never " Release it to the public" Although all the addons I do use I already have the original author's consent to redistribute.

Or, you could make em an all-in-one addon, with subroutines for each class, and use:
Code:

if (select(2, UnitClass("player"))) ~= "ROGUE" then
for a rogue, for example. Then you'd have one addon, and it would then just call the appropriate subroutine(s) for the class.

Nobgul 09-10-10 03:32 PM

Quote:

Originally Posted by break19 (Post 205696)
Or, you could make em an all-in-one addon, with subroutines for each class, and use:
Code:

if (select(2, UnitClass("player"))) ~= "ROGUE" then
for a rogue, for example. Then you'd have one addon, and it would then just call the appropriate subroutine(s) for the class.

You Know thats how I setup my AbilitySayings addon. Didint even think of it 0_o.. Thanks

Vlad 09-11-10 07:24 AM

You can create 1 addon and include 3 addons in it, but you must consider the savedvariables used by the other addons (for saving their settings) and properly include all their libraries and such. :)

break19 09-11-10 07:26 AM

Quote:

Originally Posted by Vladinator (Post 205812)
You can create 1 addon and include 3 addons in it, but you must consider the savedvariables used by the other addons (for saving their settings) and properly include all their libraries and such. :)

IIRC, you can just include the proper files in the savedvariables token in the toc, and you're golden.

In theory anyway. lol

ravagernl 09-11-10 08:28 AM

Why not make an addon that iterates over all the addons you have installed, and check if it should be loaded by having a table with the addons you want loaded for your class / playername?

EDIT: LOD addons would be a problem however :/

xConStruct 09-11-10 08:36 AM

Like Addon Loader? :)

And then adding into each of the class-specific addons toc (Wiki Page):
## LoadManagers: AddonLoader
## X-LoadOn-Class: Rogue

I'm using this system in all of my addons for speeding up loading screen by loading on demand / delayed.

On topic: If you move addons into a single addon, you'd need to take care of the paths from the textures / fonts provided by the addon, if any.

Nobgul 09-15-10 11:04 PM

Cargor,

Thank you this is 100% what I was looking for. It should solve my needs.


All times are GMT -6. The time now is 12:39 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI