Run a function when InterfaceOptionsFrame gets closed
I have an addon that hides a part of UI under certain conditions with an option to simulate those conditions and test how UI changes. Everything can be done inside the InterfaceOptionsFrame. One problem is that it is possible to close the frame when options remain in simulation state and then the UI remains altered. I would like to run a small function whenever interface frame is closed so my addon can restore the default UI state.
The addon is totally based on Ace libraries. As such, I have Ace-Addon, Ace-Event to register and handle all events, and Ace-Config including Ace-ConfigDialog to create InterfaceOptionsFrame. I can't find anything on hooking the Interface Frame when it gets shown or hidden. Is possible? Thanks |
Quote:
|
Quote:
EDIT. I tried to make a dialog box but I stuck again -,- As I use Ace3 I would like to avoid native LUA functions. I tried to follow suggestions on Ace3 website and create option table. The table would then be used to register a new dialog box but it's not clear how to do that. I have a table like this: Lua Code:
I can't find how to register this dialog, how to open it and how to respond when it is closed. Hope someone can help. Thanks. |
To answer your original question, you can hook the Interface Options Frame OnHide script/widget:
Lua Code:
I use this to get around taints involved with Blizzard's provided "cancel" function in the options api. |
Hey,
Thanks for your code. I’ll try it tomorrow. I’d also have a go with the idea of a config as soon as I can sort out the dialog box. |
All times are GMT -6. The time now is 07:20 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI