Thread Tools Display Modes
05/04/23, 11:49 AM   #1
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Question Addon compatibility with other addons

Hey guys,

Im beginning to look into compatibility for my addon with other major popular ones and could use some pointers.

Fort example i've found an issue with my auto banking and Dolgubon';s lazy writ creator with banking functions. His pulls items out for writs 1st and then mine is throwing them right back in after.

Generally speaking Id like to deal with that on my end but in my head it seems highly complex detecting what his addon is doing from mine and MUCH easier for his addon to temporarily disable my feature and then re-enable it after maybe using one of my global functions?

I literally have a function that could be called to disable mine similar to "function MyFunction(false)" and then true to re-enable it after.

How would another addon call my function and is that even possible? I suspect it is as I've seen something like this for TTC pricing.

Should I approsch Dolgubon and request an addition like:

Code:
If MyAddon ~= nil and MyAddon.savedVariables.autoBank == true then
     MyAddon(function MyFunction(false))-- or something similar
     MyAddon.disabled = true
end

and then when hes done
if MyAddon.disabled == true then
     MyAddon(function MyFunction(true))-- or something similar
     MyAddon.disabled = nil
end
Im not yet the big fish here so I'm not sure if this request would be out of line or something. Sharlikran got all pissy with me for requesting some TTC pricing feature be added to Inventory insight for example. I never understood why and then 2 weeks later I discovered MM was also his addon and it all made sense =p

OR....

Is there a fairly easy way to determine what another addon is actively doing so I can manage my own features accordingly? Actually even a way to detect if the bank was opened by the player or another addon would do the job maybe. I could reuse this for any of my functions that have conflicts but I think my auto banking is going to be the primary issue when other addons take stuff out before my code is run.

Last edited by sinnereso : 05/04/23 at 12:15 PM.
  Reply With Quote
05/04/23, 12:13 PM   #2
Navarill
Join Date: Jun 2022
Posts: 10
Originally Posted by sinnereso View Post
Hey guys,

Im beginning to look into compatibility for my addon with other major popular ones and could use some pointers.

Fort example i've found an issue with my auto banking and Dolgubon';s lazy writ creator with banking functions. His pulls items out for writs 1st and then mine is throwing them right back in after.
Take a look at how Leo's Trainer handled the same issue.

Last edited by Navarill : 05/04/23 at 12:16 PM.
  Reply With Quote
05/04/23, 12:16 PM   #3
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
oh kewl ty. on it.

WOW that was easy.. crude but easy to detect if other addons are running and may do the job.

I could bypass by banking code if other known banking addons are running super easy which I might do temporarily and display a chat msg to that effect when it happens as a quick fix while I learn how this works more.

Last edited by sinnereso : 05/04/23 at 12:40 PM.
  Reply With Quote
05/04/23, 12:59 PM   #4
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Yeh this is working perfectly at least for now.. Ill add every popular banking addon I cant find to this for the moment until I learn how to refine it better. It just disables mine if others are present which is ok as mine is very basic more for new players or those wanting super light weight and aren't eso+. Virtually any other banking addon is more advanced. This is perfect right at the top of my banking function. ty for the tip.

Code:
if PersonalAssistant or WritCreater then--DISABLE BANKING IF OTHER BANKING ADDONS LOADED
	MyAddon.AutoBankToggle(false)
	MyAddon.AutoTelvarToggle(false)
	df(MyAddon.logo .. " Addon Conflict: Auto Bank & Telvar |cCC0000DISABLED|r")
	return
end
Ideally id like to re-enable mine if its just writcreator opening bank after hes done banking maybe with a delay but well see what I come up with.

**EDIT**
Actually ive for the moment decided against disabling mine if any other bank addon enabled as it wouldn't make sense to have multiple running when mine can be easily disabled from settings. I'll leave that to the player to decide which they want to use. im going with temporary disabling while lazy writ creator is running accessing bank for the moment since Id like to use his addon myself

Last edited by sinnereso : 05/04/23 at 01:44 PM.
  Reply With Quote
05/05/23, 12:07 AM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,964
You can also read the other addons saved variables to check if this auto pull from back feature is enabled at all as the SV table is always global. But do not change that! Only read please!

Just blocking your feature is the other songaddon is loaded, but the feature at the addon is Off, it's not needed imo.

Check the txt file of the other addon what is the name of the SV file and check in the addon code how it was setup, acvounwide or per character, per server or not etc. Check if the addon provides global functions to read settings so you do not have to build the read code yourself. Else you need to manually check what the actual SV looks like and then read the setting in question from the appropriatevsubtable of the global SV table.
  Reply With Quote
05/05/23, 11:48 AM   #6
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
TY this helps alot actually. Lazy Crafter has a built in function for it but I may need to do this for PA for finer control of specific functions. Or I might just do it this way as a standard because I have so many functions, Im anticipating conficts and NOW is the time to iron them out . At least for the BIG HIGHLY POPULAR addons. Im looking at them now and will not change theyre settings no worries. Just need to know what they are so I can control my addon accordingly. My hopes is to achieve perfection without them needing any modifications.

I did have a question though regarding lazy writ crafter for example. Ive found his saved vars and appears to have 2.

Code:
(1)WritCreater.savedVarsAccountWide = ZO_SavedVars:NewAccountWide(
		"DolgubonsWritCrafterSavedVars", WritCreater.versionAccount, nil, WritCreater.defaultAccountWide)
and

Code:
(2)WritCreater.savedVars = ZO_SavedVars:NewCharacterIdSettings(
		"DolgubonsWritCrafterSavedVars", WritCreater.version, nil, WritCreater.savedVarsAccountWide.accountWideProfile)

for a specific setting(shouldGrab) should I account for both? like this below? and I still dont understand why my account wide settings in it are saved in (2).

Code:
if WritCreater.savedVars.shouldGrab or WritCreater.savedVarsAccountWide.shouldGrab then

Last edited by sinnereso : 05/05/23 at 11:59 AM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Addon compatibility with other addons


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off