View Single Post
02/07/15, 06:51 AM   #41
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
I got some feedback from Seerah and also the OK to change the license in order to put LibAddonMenu on github.

Originally Posted by Seerah
As for the conversation on the forums about LAM... My two cents' worth:

A user should expect to download an addon and for it to "just work". This is why libraries get embedded. The "standalone libraries" usage is an "advanced users" concept over in WoW. That said, LAM and LibStub can already be installed standalone. LibStub is about 1.5 kb and LAM is about 58.7 kb. You're not saving much on your hard drive by pulling it out of 10 addons to have it installed standalone. And LibStub will only load the files into memory to upgrade a version previously in memory. If the first addon loaded is the newest, then the others return out as soon as they start to be read. If, by the end of the loading process, more than one copy of the library has been loaded into memory, they'll be tossed at the first garbage collection cycle.

Libraries should not need saved variables. If a library needs saved variables, then the question should be asked whether it is a true library or an addon. Anything having to do with altering the look of the menu (templates, etc.) should be a separate addon. Most users won't care about that stuff, and fluff code like that does not affect the usage and purpose of the library itself. With it being a separate addon, you can then have a settings menu for it and saved variables.

Oh, and there shouldn't really be a need to save what panel you're looking at across sessions. Convenient for a dev that's constantly reloading, yes. But that's a fringe-case scenario and not something the general user is concerned with.

From a design standpoint, let me explain why the checkbox controls are as they are. LAM-1.0 used the game's own options control templates to create the LAM controls. When I made LAM-2.0, I kept them the same way so that they would be 1. consistent with both LAM-1.0 and with the default game settings, and 2. line up vertically with the other control types. If the general consensus is to make them different from the look of the game's settings, then so be it.

For votan's comment
PS: I think it is dangerous and un-maintainable, that each control has its own revision mangement and basically can come from "anywhere".
The controls are in separate files than the main LAM core. To ensure that an older version of a control doesn't overwrite a newer one (because LibStub will only return out of loading the LAM core), they either have to register a version with LibStub or with LAM. I went with LAM so that it has full control over the controls. Also, other authors/addons can create their own control to register with LAM for their options. This could be contained in their addon, or a new library with addition control types could be developed.

Also, an addon only including a few control types shouldn't have an effect on another addon that depends on a different control because that addon should be including LAM and the control files as well. As mentioned above, the controls get registered through LAM, and LibStub will only return out of an older LAM core, not the controls.
Following this advice I suggest that we either take all the extra things that are not required and put them into a standalone addon that always contains the newest LibAddonMenu and keep the library itself as simple as possible or scrap them completely.

Style templates are probably something nobody would use anyways. Might be easier and more useful to just add a settings panel where you can set line width, choose between a few different backgrounds and that's it.
The second level of customizations is probably also a bit over the top. Might be enough to let addon devs choose the column width of the panel, so they can adjust the layout for different languages.

The categories are something we can do without save vars in the base version and once a user installs the proposed addon, it will save the state.

Some possible names for the new addon that come to mind are "AddonMenuEnhanced", "EnhancedLibAddonMenu", "LibAddonMenuPlus", but I am open for suggestions

I'll set the github projects up later today or tomorrow.
  Reply With Quote