Thread Tools Display Modes
Prev Previous Post   Next Post Next
01-07-23, 02:33 PM   #1
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,894
Intrinsic (template) reusability in addons

Originally Posted by Gello View Post
One of my addons has an intrinsic button template called RematchCompositeButton that I've been using for some time that...
Gellow statement sounds like the intrinsic would be useful in more then one addon but I'm wondering how it might be packaged/versioned for this.

Has anyone seen any discussion, have thoughts, about if/how intrinsics and or templates might be able to be used/versioned across multiple addons? I have a generic widget created as an intrinsic that would be usable (maybe even useful) across multiple addons not just my own. It's created as an intrinsic because it needs the scripting additions that templates and lua don't have (although it's crippled as a base widget for XML because of the scripting limitations there, "Frame does not have an OnValueChanged script".

Templates you can work around by creating one or more widget factories but intrinsics are explicitly XML only. You can't embed the xml in more than one addon because the "Node Already Exists" error.
If you make it a standalone addon you run afoul of addons that package it overwriting a new version with an older one.

So, other than a "get it right the first time and pray a Blizzard change doesn't bugger it up" or create a new addon for each version, can anyone think of (know of) a mechanism that might cover this?

LibStub is seemingly not made for this.

For the multiple node errors I can see something like a "noexists" or "once" attribute to ignore multiple instantiations (along with my other some day suggestion, a "scripts" attribute scripts="OnValueChanged, ...") might be nice but versioning would still be a problem.

Being able to create intrinsics with CreateFrame would be an answer to both problems (but not adding/hooking "unknown" scripts for XML use) but until then...?
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 01-07-23 at 02:41 PM.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Intrinsic (template) reusability in 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