ESOUI - View Single Post - Jack of all Trades
View Single Post
03/03/21, 11:51 AM   #24
Super Moderator
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,052
Originally Posted by CyberOnEso View Post
Thank you very much for this! I will certainly look at implementing it.

When I have time I will certainly look at implementing the LAM callback as Baertram suggests. However, as far as I am aware wouldn't doing it this way cause refreshes for all 14 drop-down lists whenever you change any setting? Maybe it's not really intensive, however, any input on if any part of the addon causes more lag/ server strain than necessary would be really appreciated.

Thank you both for your suggestions, I do really appreciate it!
Yes, could be.
Depends on how the functions to select the current dropdown selections and build the new entries + UpdateChoices are currently set to run.
I only thought about using setFunc will be called if you change anything. Could get you into trouble as setFunc of box 1 updates entries of box 2 choices/chociesValues, which then calls getFunc and/or setFunc again and will continue the chain call.

Depening on the number of boxes, and their relations/depencies, using the refresh callback, and "collecting all dropdown data" prior to only running an UpdateChocis once to update to all of them (throttled so that the next refresh won't be run within millisecons e.g. via EVENT_MANAGER:RegisterForRefresh with always the same unique event name), might be better. Depends on the usecase. But I remember using setFunc directly got me severe headache in the past.

I did not find the time to check the code of the lam settings in detail. Could be this already is the most optimized way. Sorry for the confusion then.