View Single Post
03/28/23, 08:58 AM   #36
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Originally Posted by Baertram View Post
The callback for lam needs to be registered once! In you addons settings code. Not each time in your "SavePlayer" function.

Having it the way you use it now will make the else... execute for each addon, not only yours! If you use 30 addons with settings (or anyone else using your addon does) it will run the panel callback code 30 times for nuts!

Just move the callback code to the lam creation and use the panel parameter of the callback to check if it is your panel as described above in my last post (you get the panel to compare from your lam registerAddonPanel function! After that create the callback for controlsCreated once, and also create the callback for panelOpened to update your description. This will update the description label each time your settings panel opens, so using your player saved function does not need to update that label, unless you use it while the settings panel is actually opened? Then just check if the control is not nil and update directly ).
OH WOW! ty.. ill take a look at it right now. And yes the label doesn't need to be changed while in the addon settings so that might work even better. It can only be changed from guild group or friends menus.
  Reply With Quote