Library version checking
I was reviewing the LibUIDropDown codes and then realized I made a mistake by putting version revision in the MAJOR_VERSION, which will result in multiple version of libs get loaded and some functions could be conflicted.
Before: Lua Code:
Now I have fixed it to below: Lua Code:
But I am wondering how to do similar version checking in XML files? The LibUIDropDownMenu has two XML files, and while synchronizing the changes in WoW 8.0.1, there are several changes need to be implemented in those XML files. So question pops up. Instead of moving all those XML UI to be handled in Lua, I wonder if there is some easy way to do it within XML file. |
Is LibUIDropDownMenu is needed anymore? If they fixed dropdown taint in 8.0 I don't see a reason to use it.
|
That's a good point, but I am not sure if they fix the dropdown taint.
|
They have added new XML templates and Lua mixins for the dropdown menus, but I have not been able to test if using those new templates avoid the taint yet.
As for your original question, I have had the same issue with a custom lib I'm doing to share between my projects and I have not been able to find a solution either. One thing I had in mind at some point was that if you are using a packager for your add-on you are able to insert tags that would be automatically replaced by the version number. I was thinking that having XML names as "AddonName@project-version@_WidgetName" would make different names for different versions of the lib. But I have not tried that yet and it sounds like a hacky solution :S |
For UIDropDown, the new stuff is related to Custom Frame. Comments from UIDropDownMenuTemplates.lua:
Lua Code:
Regarding to the possible workaround mentioned by Ellypse, I think technically it may work. But this would also introduce some problem for other addon's developer when then need to use those UI element. |
|
Late to the party, but a couple of quick notes. Neither of these are in the LibStub documentation.
This line: Lua Code:
Lua Code:
The second thing several library authors forget is that all but three libraries should be loaded on demand. The exceptions being Ace3, LibStub, and CallbackHandler-1.0. For all other libraries, the following line in the .toc ought to be added. It certainly is not critical, but there is no point on loading a library if no addon actually uses it. Lua Code:
|
Quote:
|
All times are GMT -6. The time now is 08:20 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI