Disclaimers
If you use this, please check to make sure any addon menu bugs are not with the interface before submitting to Seerah. If in doubt, submit the bug here first, and I can help verify.
This is for addon authors
only. It does
not convert the settings menu from 1.0 to 2.0 for end users. As such, I have not included a manifest/txt file, so the game will not detect this if downloaded directly.
I do not make any claim to own the LAM code. I have obtained permission to upload an interface, but the original rights for code and API are reserved by Seerah.
Overview
This enables authors with simple usage of LibAddonMenu-1.0 to quickly start using LibAddonMenu-2.0.
This does not convert your code, just provides a simple adapter to keep using your LAM-1.0 coding with LAM-2.0
As well, this allows you to use a function-based interface rather than constructing and passing in the table yourself.
Requirements
Not all addons that use LAM-1.0 can be converted using an interface. In particular, if you do any of the following, you will just have to keep using 1.0 or rewrite to convert to 2.0:
- NOT use code to adjust the settings panel directly
- NOT use the values returned from the LAM functions for anything other than passing into other LAM functions
- NOT adjust properties of LAM directly
These situations are impossible (or close enough) to code an adapter for. As well, LAM2 provides better customization for advanced usage.
Usage
Warning: With 1.4 release, ZOS has a reduced path length limit (See
here for details). This library by default has a rather long name and can easily exceed that if nested deeply.
- Remove the LibAddonMenu-1.0.lua file and any references to it from the manifest (.txt) file.
- Download LibStub and follow the instructions there to set it up
- Follow the instructions in LAM-2.0 and set it as if you were using the 2.0 version.
- Download this addon and add the interface file to your addon. Make sure to include an entry in the manifest (.txt) file after any LAM entries.
- Change the following one line where you declare LAM for usage from
Code:
local LAM = LibStub("LibAddonMenu-1.0")
to
Code:
local LAM = LibStub("LibAddonMenu-1.0-to-2.0")
If you meet all the requirements, that's it!
Currently, this is just intended for upgrading, and does not contain any of the new functionality (textures, custom panels).