Ace3 Options: Refresh specific option after another option changes. How?
Hi Ladies and Gentleman, its me again.
Today I have a question about ace options. I have the following code: Lua Code:
As you can see I have options for changing the position of my minimap. You can choose the anchor ("TOP", "BOTTOM", "LEFT", etc.) and the x and y offset. However, for the min and max values of the offsets I calculate the min and max x and y offset of the minimap in relation to the anchor. Example: Lua Code:
That means ofcourse that whenever the "anchor" option changes the offset min and max values in the options need to get updated. How can I make the options refresh for the offsets after the anchor changed? |
You have a few options, depending on how you want to code.
|
Quote:
AceConfigDialog does not seem to have a NotifyChange(appName) function: https://www.wowace.com/projects/ace3...fig-dialog-3-0 EDIT: I guess you meant AceConfigRegistry... I tried it: Lua Code:
Lua Code:
Seems like NotifyChange has no effect at all. |
Turned out that NotifyChange will have no effect when called from within a setter since
setting a value already leads to a GUI refresh automatically. The thing is that min and max is only initialized once at creation. Currently there is no way to add a function here. So I need to set the min max values manually: Lua Code:
|
If I'm understanding correctly, it's something that I have to deal with in Executive Assistant.
You can look at the code in there (link in signature) to see how it's done. There's a bit of a trick to it, involving pruning and rebuilding that part of the tree so that the control reacts dynamically in the configuration. (ea_Options.lua :: ExecAssist:semiSmart_regrow() if memory serves) In this case, after you change the 'anchor' control, you'd prune and rebuild the offset.args.x and offset.args.y controls. |
The other idea is that each time the user changes the anchor, run the function that sets or gets the x and y offsets immediately after, within the options to change the anchor.
This means you will need to rewrite slightly: Lua Code:
|
All times are GMT -6. The time now is 10:26 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI