Thread Tools Display Modes
05/04/14, 05:59 AM   #1
Sideshow
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 36
Options, big ! (LAM)

Hello

The options panel of "combat cloud" is pretty much the size of a mammoth now, and growing.

Reading about the problems with LAM (although I don't think LAM is the cause), what are MY options?
If I make something on my own, won't I end up with about something that's almost the same as LAM?

Things I tried:

* zo_callLater(CombatCloud_CreateMenu, 500)
* creating just one button, so the user can "manually" load the rest of the options panel with 1 click

For some reason, the 1st is hilarious. The second was actually not a bad idea imho, but the options panel started to behave really weird ???

Any opinions? I'd really hate it to make seperate, "custom" windows and controls, just to edit some flags and numbers in the settings object
  Reply With Quote
05/04/14, 07:09 AM   #2
Divona
 
Divona's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 12
I'm at the same crossroads. Even sub-menu in new version of LAM doesn't seem to help much.
  Reply With Quote
05/04/14, 07:25 AM   #3
Sideshow
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 36
Actually, I'm investigating the second option by reading LAM itself.
It will work, but I will have to update all my controls manually.

Pictures to explain:

- first it will be like this: https://dl.dropboxusercontent.com/u/38282964/1.jpg
- after click: https://dl.dropboxusercontent.com/u/38282964/2.jpg
- after switching to another panel and comming back: https://dl.dropboxusercontent.com/u/38282964/3.jpg

I came to the conclusion that I just need to trigger the "OnShow" event on the controls after clicking on the "Open" button.

Happy to have found this :-)
  Reply With Quote
05/04/14, 09:07 AM   #4
Sideshow
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 36
When making the LAM calls, I added all controls to a local table.
Afterwards doing something like
Code:
for _, v in ipairs(controls) do
    local onShowFunc = v:GetHandler('OnShow')
    if (onShowFunc ~= nil) then onShowFunc() end
end
or
Code:
for _, v in ipairs(controls) do
    v:SetHidden(true)
    v:SetHidden(false)
end
works, but not for sliders. I have looked at it for half an hour now, but it beats me
Switching to another panel and back, still works though...
Aah, the wonders of eso & lua
  Reply With Quote
05/04/14, 01:17 PM   #5
Iyanga
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 183
Originally Posted by Sideshow View Post
Reading about the problems with LAM (although I don't think LAM is the cause), what are MY options?
Slash commands.
  Reply With Quote
05/04/14, 03:45 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
@Sideshow (et al.):

You can create your controls whenever you need to. In your button's OnClick handler, just create the options when the "Show" button is clicked if they haven't been created yet.

The same is true for when using sub menus.

Or if you want to tie into the OnShow event of your panel's header.......
  Reply With Quote
05/04/14, 05:14 PM   #7
Kith
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 49
I'm still using the basic LAM functionality but I ... mucked around... with the code quite a bit to 'fake' adding tabbed panels in my latest mod (S'rendarr) to avoid the anchors processing message. I have it set to load only the tabs themselves when the mod is loaded, everything else is loaded at run time when its actually used. This may help if you want to try breaking up options in a similar manner.

Lua Code:
  1. -- this is added into my settings initialization
  2. ZO_PreHook('ZO_OptionsWindow_ChangePanels', function(panel)
  3.     if (panel == controlPanel) then
  4.         if (not tabPanels[1]) then -- first time viewing settings, create first tab
  5.             BuildTabPanel(1)
  6.         end
  7.     end

BuildTabPanel actually creates the LAM items for that panel at the time and (with 4 tab buttons in my options), each of the 4 creates its own panel only when first clicked. I've faked the panel method by calling SetParent on each LAM item after creation to attach it to a CT_CONTROL panel which is then hidden/shown as needed.

The only funky bit that needs to be done to make it work this way is to call these two functions after creating the new elements :
Lua Code:
  1. ZO_OptionsWindow_UpdatePanelOptions(controlPanel, 1) -- force option update to properly initialize settings
  2. ZO_OptionsWindow_ChangePanels(controlPanel)
  3. -- where controlPanel = your return from a new panel in LAM (the # id of your panel)
This forces the ZO code to refresh your settings to be properly interactable (they aren't without the first one) and show their proper values (they don't without the second one).

Just as an aside, due to the order of events firing when opening the settings I used zo_calllater to show some examples so its not that hilarious :P

Last edited by Kith : 05/04/14 at 05:17 PM.
  Reply With Quote
05/05/14, 01:00 AM   #8
Sideshow
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 36
Originally Posted by Seerah View Post
@Sideshow (et al.):

You can create your controls whenever you need to. In your button's OnClick handler, just create the options when the "Show" button is clicked if they haven't been created yet.

The same is true for when using sub menus.

Or if you want to tie into the OnShow event of your panel's header.......
That's what I did? When clicking the button, I create all the controls.
LAM adds an OnShow handler which will init the control, well, on show....
Problem is, when creating the controls, the OnShow event is not called (but the controls are still visible... makes sense..).
It is only called when opening the control panel, or by manually calling the OnShow for each control (or tiggering via hide/unhide). This is a problem for sliders... which still only work when a panel change occurred.
  Reply With Quote
05/07/14, 01:21 PM   #9
Sideshow
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 36
Originally Posted by Kith View Post
....
Thanks a lot, with ZO_OptionsWindow_... everything seems to be OK !
  Reply With Quote
05/10/14, 10:06 AM   #10
Mitsarugi
 
Mitsarugi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 23
You could have a look at Wykkyd's Addons they use the same option

Originally Posted by Sideshow View Post
Hello

The options panel of "combat cloud" is pretty much the size of a mammoth now, and growing.

Reading about the problems with LAM (although I don't think LAM is the cause), what are MY options?
If I make something on my own, won't I end up with about something that's almost the same as LAM?

Things I tried:

* zo_callLater(CombatCloud_CreateMenu, 500)
* creating just one button, so the user can "manually" load the rest of the options panel with 1 click

For some reason, the 1st is hilarious. The second was actually not a bad idea imho, but the options panel started to behave really weird ???

Any opinions? I'd really hate it to make seperate, "custom" windows and controls, just to edit some flags and numbers in the settings object
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Options, big ! (LAM)

Thread Tools
Display Modes

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