View Single Post
03/03/21, 10:30 AM   #21
Gabriel_H
 
Gabriel_H's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2021
Posts: 11
Originally Posted by Baertram View Post
About LAM and the resfresh:
Set your addon panel to listen for refreshs like described in the LAM documentaion ->

local panelData = {
...
registerForRefresh = true,
}

There is a clear callback for LAM-RefreshPanel of the lam panel where you register your function and check if the panel is your LAM panel
(local myAddonPanel = LibAddonMenu2:RegisterAddonPanel(gAddonName .. "_LAM", panelData) -> in the callback function if panel (1st param of the callback func) ~= myAddonPanel then return end)
, and then you should call your refreshConflict function for the needed dropdown controls (predefined in a table "for _, dropdownControl in ipairs(updateThisControls)").

Using the setfunc will get you into trouble earlier than you might think off.
The panel is set for registerForRefresh - it does not refresh dropdown choices. However, it does build a table for functions to be refreshed, which is what my refreshConflict function parses.

All the setFunc is doing is firing as it normally would to save the variable to the saved variable tables.

Last edited by Gabriel_H : 03/03/21 at 10:32 AM.