Differences between v1.0 and v2.0 - sirinsidiator/ESO-LibAddonMenu GitHub Wiki

  1. LAM1 was function-based for authors using it, whereas LAM2 is more table-based. Instead of calling a function for every options control you wish to create, with LAM2 you create a table that houses all of the data for your panel and another for the data of your options controls, and then pass these tables to LAM2 through only two functions (one to register your addon and create a panel, and the other to assign your options to the panel).

  2. LAM2 comes with 85% less hacks around ESO’s default options controls interface and templates. This makes it cleaner, leaner and smoother.

  3. Getting your hands dirty with LAM1 was difficult, to say the least. It is all much easier with LAM2. Want a global reference to your control to manipulate it later? There’s an optional field for that in each option’s data table. (References are now optional so that they don’t clutter the global namespace.) Use this reference to alter your control, call control:UpdateValue() or control:UpdateDisabled(), or add your own methods to it.

  4. Going along with #3 above, there is a new control type called “custom.” This allows you to basically create a container in a LAM2 addon panel where you can place any sort of custom control you wish to be in your GUI.

  5. LAM1 forced you into using the LAM1 controls with a LAM1 created addon panel. With LAM2, the methods to create the controls are exposed, allowing you to use LAM2 as a factory for building options. If you want it done, you can probably do it. Use LAM2 controls without a LAM2 panel, or create a LAM2 panel but use your own controls, or use both (LAM2 panel with LAM2 controls), but create it all manually yourself, instead of letting LAM2 handle anchoring, etc. for you.

  6. Four new features are available in LAM2 that were not present in LAM1:

    • Controls now have an :UpdateValue() method. This allows you to manually change the value the control is set to.
    • Controls may now be disabled based on the value of another control. There is also an :UpdateDisabled() method for controls.
    • Panels will now refresh what is displayed when a setting is changed or the panel is shown if the registerForRefresh field is set to true for the panel. This picks up any changes made to the saved variables outside of the options controls.
    • Controls may have a default value to be used if LAM2’s new “Reset To Defaults” button is pressed. This is enabled if the registerForDefaults field is set to true for the panel.
  7. In LAM1, a checkbox control had to toggle itself through myVar = not myVar. In LAM2, the value of the checkbox is passed through to your “set” function. This ensures your variable is always set to the correct value with the new :UpdateValue() method and panel refresh feature.

  8. Controls in LAM1 were only anchored vertically, so as to mirror the default options panels. LAM2 allows you to set a control’s width to “half”, which allows 2 controls per line.

  9. There have been concerns with the number of entries added to the game menu due to the popularity of LAM1 with addon authors. LAM2 now only creates one entry in the menu, called “Addon Settings”. The main LAM2 panel houses a menu to select which registered addon’s options to view - and it’s alphabetized.

  10. ESO has a problem with creating many controls at once, which throws an error onto confused users’ screens. LAM2 holds back creation of options controls until the addon’s panel is viewed for the first time. In addition to controls not all being created at the same time, this has the added benefit of not eating up resources if a user doesn’t view the options panel that session.

⚠️ **GitHub.com Fallback** ⚠️