Need help with OptionalDependsOn
My addon specifies
## OptionalDependsOn: LibAddonMenu-2.0 and the code does this: LAM = LibStub('LibAddonMenu-2.0') With only my addon loaded, this line throws the mystifying exception function expected instead of nil. I say mystifying because if LibStub is not defined then the exception I would expect is attempt to call local/global LibStub (a nil value). I can make the untrapped exception go away by wrapping the assignment in a pcall() but all that does is silence the message. With LibAddonMenu-2.0 loaded (or any other add-on that uses it) then everything works as expected. So it appears that this bit of the addon has all along been been working only by accident because some other addon had already successfully loaded the library I want. My question is, what could I be doing wrong? My instincts suggest a typo, but if it is, I just can't see it. There are only 2 lines of code to look at, and 16 filenames to check (LibStub, LibAddonMenu and its 14 controls). Here they are: lib/LibStub/LibStub.lua lib/LibAddonMenu-2.0/LibAddonMenu-2.0.lua lib/LibAddonMenu-2.0/controls/button.lua lib/LibAddonMenu-2.0/controls/checkbox.lua lib/LibAddonMenu-2.0/controls/colorpicker.lua lib/LibAddonMenu-2.0/controls/custom.lua lib/LibAddonMenu-2.0/controls/description.lua lib/LibAddonMenu-2.0/controls/divider.lua lib/LibAddonMenu-2.0/controls/dropdown.lua lib/LibAddonMenu-2.0/controls/editbox.lua lib/LibAddonMenu-2.0/controls/header.lua lib/LibAddonMenu-2.0/controls/iconpicker.lua lib/LibAddonMenu-2.0/controls/panel.lua lib/LibAddonMenu-2.0/controls/slider.lua lib/LibAddonMenu-2.0/controls/submenu.lua lib/LibAddonMenu-2.0/controls/texture.lua |
You're calling LAM from your main lua file and you've set your main file to load BEFORE LAM, so you're going to run into an issue.
|
Thank you. I didn't know that the order of the modules in the .txt file was significant. So it was a typo, of a sort.
|
Quote:
|
All times are GMT -6. The time now is 01:02 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI