View Single Post
05/29/14, 06:11 AM   #10
lyravega
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 93
Originally Posted by Garkin View Post
It's true that code I have posted before did not store original callback, so it won't work the way we want. lyravega's code does not cause issues just because he calls ReloadUI() from the callback.

So I was digging around and I found that dialog displayed from the callback is "OPTIONS_RESET_TO_DEFAULTS" and from this dialog is called function ZO_OptionsWindow_LoadDefaults(). So maybe hook this function?

Lua Code:
  1. ZO_PreHook("ZO_OptionsWindow_LoadDefaults",
  2.    function(control)
  3.       if ZO_OptionsWindow.currentPanel == yourPanelId then
  4.          --your code
  5.          return true --true means that ZO_PreHook will not call original function
  6.       end
  7.       return false
  8.    end)
How did you find the function from a dialogue :s Looks interesting, will try some stuff out
  Reply With Quote