Thread Tools Display Modes
06/16/14, 08:16 AM   #1
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
LAM 1.0 syntax?

Serrah recently updated LAM to version 2.0 and while doing so took down the syntax for the old version.
I am really bad at memorizing syntax. And learning 2.0 will propably take some dedicated time.

Anyone still having the old Syntax lying around?
  Reply With Quote
06/16/14, 09:31 AM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Lua Code:
  1. LAM         = LibStub("LibAddonMenu-1.0")
  2. panelID     = LAM:CreateControlPanel(controlPanelID, controlPanelName)  --required
  3. header      = LAM:AddHeader(panelID, controlName, text)                 --each panel must have at last one header
  4. slider      = LAM:AddSlider(panelID, controlName, text, tooltip, minValue, maxValue, step, getFunc, setFunc, warning, warningText)
  5. dropdown    = LAM:AddDropdown(panelID, controlName, text, tooltip, validChoices, getFunc, setFunc, warning, warningText)
  6. checkbox    = LAM:AddCheckbox(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
  7. colorpicker = LAM:AddColorPicker(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
  8. editbox     = LAM:AddEditBox(panelID, controlName, text, tooltip, isMultiLine, getFunc, setFunc, warning, warningText)
  9. button      = LAM:AddButton(panelID, controlName, text, tooltip, onClick, warning, warningText)
  10. description = LAM:AddDescription(panelID, controlName, text, titleText)
  11. submenu     = LAM:AddSubMenu(panelID, controlName, text, tooltip)
  12.  
  13. --return value panelID is an index (number) stored in _G[controlPanelID]
  14. --return value from all other functions is the control itself
  15. --argument panelID is either panelID (type "number") or submenu (type "userdata")
  16. --all warnings are optional and can be omitted
  Reply With Quote
06/16/14, 09:46 AM   #3
ingeniousclown
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 122
I advise you to just learn 2.0. It takes some rewriting, but it is not difficult at all and actually includes more features and less risk for "too many anchors" nonsense.
  Reply With Quote
06/16/14, 10:49 AM   #4
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
Originally Posted by ingeniousclown View Post
I advise you to just learn 2.0. It takes some rewriting, but it is not difficult at all and actually includes more features and less risk for "too many anchors" nonsense.
I will. But one serious rework/development at a time.

The 1.0 version is easier during development as you need one less click to get to the menu page.

I am also thinking of providing the LAM 1 Menu as option.
While the second version with the sub menu is a lot better, some addons that the user thinks important enough might offer the ability to show themself as a seperate entry using the old style.
  Reply With Quote
06/16/14, 11:07 AM   #5
ingeniousclown
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 122
LAM2 supports the ability to open directly to the settings menu with a slash command, which you can register through LAM2 itself as you create the panel.

That also means that you can assign a keybind or on-screen button to it by wrapping the slash command in a function and calling it directly. That's less keystrokes + clicks than LAM1 by a longshot.

As for the "important enough for the old style" argument... not sure I agree but that's purely my opinion.
  Reply With Quote
06/16/14, 11:29 AM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
You don't even need to do that. Just use the lib:OpenToPanel(panel) method.
  Reply With Quote
06/16/14, 08:30 PM   #7
Sasky
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 231
Originally Posted by zgrssd View Post
I will. But one serious rework/development at a time.

The 1.0 version is easier during development as you need one less click to get to the menu page.

I am also thinking of providing the LAM 1 Menu as option.
While the second version with the sub menu is a lot better, some addons that the user thinks important enough might offer the ability to show themself as a seperate entry using the old style.
Took a quick look and you should be able to use this for a quick (~5min) change:
http://www.esoui.com/downloads/info5...Interface.html
You can then come back and switch it to the LAM2 interface when you have more time.

For letting users show as a top-level, if that's what's desired it should be an addon to LAM2 and not coded into each individual addon. You could make something where you select which addons to show in the overall menu. In that case you don't need to depend on the 1.0 (unsupported) library or re-use it for every addon that needs/wants that functionality.

Besides, from what I've seen, the main end-user comment is how to get the older ones to a unified menu faster, not retain some way of keeping a separate settings entry.
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » LAM 1.0 syntax?


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