View Single Post
01/06/22, 10:30 PM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,009
If the other addon just uses normal EVENT_*whatever callbacks you can just use the same in your addon.
If the other addon does special magic to react on the events and you want to react on that magic of the other addon:
The other addon needs to provide an API for this, a global variable name like "OtherAddon" where you are able to call the API functions e.g. OtherAddon.GetMagicResult1() from your addon.
But you still would need to know "when" the magic was done so you are able to react on it!
For that it needs to use the CALLBACK_MANAGER to fire a callback with a unique name, where you are able to register a CALLBACK_MANAGER:RegisterCallback("uniqueName", yourCallbackFunction) to.

If the other addon does not provide such API or callbacks you cannot do anything expect overwriting the other addons code from your addon. But this also is only available if the otther addons code is global, e.g. you overwrite function OtherAddon.functionName1 with your code.
-> In general this makes no sense as you might destroy the other addon that way! You should not change other addon's code from your addon. Talk to the other dev if she/he can provide API functions and/or callbacks first!

Else you could simply copy the addon and provide a "patched version" where you include your changes.
If the author allowed this in the addon panel you will see the "Other files" tab at the addon, and there you got the possibility to [ Upload Optional Patch | or [Upload Optional Addon ].
Make sure, as you upload the patch/other addon, that the name shows it is a patch or anoher addon based on the old addon. Else one is not able to distinguish the original addon from the patched ones within Minion easily!

If the author did not allow any patches you won't see these buttons and thus cannot simply create a patch. You'd have to create your own addon then. Check the license of the other addon, and if it includes a license follow it rules! If it allows copying and changing of code give credit to the original code/author in your addon description please!
If the license forbids taking the code you are not allowed to and thus would have to build similar code by your own without copying it. Please also give credit then if you take the idea of other addons, this is just fair.
If the license even forbids taking the same idea you need to respect it and talk to to the dev.


Originally Posted by Nexmar View Post
Hi

I have tried doing my own AddOn some time ago, mainly easy stuff like automating quest dialogs. My ESO API and LUA knowledge is quite limited and I hope this is the right place to ask my question.

I would like to expand someone elses AddOn with some more functionality. Basically I would like to make a AddOn that depends on someone elses AddOn and does stuff once the other AddOn has some event / update event occur. I know I could just copy the relevant code and checks from the original AddOn over to mine, but I think it would be nicer if I could integrate with the original AddOn.

Example:
The AddOn has registered for an event, the event occurs and the AddOns function gets called, it then evaluates what happened and registers for an update event to call anothe function a bit delayed. Now I want my AddOn to do something once this update event occurs.

Generally I would like to know if this is even possible, or if I should just copy the relevant functions and register my own events and do the same checks the original AddOn does in my AddOn again, leading to more overhead. I guess the easiest would be to edit the original AddOn, but patching my changes in after every update seems stupid.

I hope my idea is not completely stupid, every help is aprectiated.

Last edited by Baertram : 01/06/22 at 10:43 PM.
  Reply With Quote