Populating a Custom Options dropdown with a function
mfeingesicht opened this issue ยท 1 comments
Is your feature request related to a problem? Please describe.
Have the possibility to populate dropdowns in Custom Options using a function.
Describe the solution you'd like
The possibility to choose a custom function when inputting the values of the dropdown, or the possibility to edit the dropdown from Actions or anywhere else.
Describe alternatives you've considered
Hard coding the combinations in On Init Actions is easy but not as intuitive.
Additional context
This came up when I tried to make a WA that would pop up if I have the wrong set equipped on a raid boss and would have the possibility of choosing which set to use on which boss in Custom Options by selecting from Dropdown Menus.
This is closely related to #1078. The main problem is that the options aren't remotely set up to handle "live" updates like this. In addition to the stuff discussed in the previous ticket, here are a few other problems that would need to be considered:
- When to run the custom function to determine what should be displayed to the user? Refreshing the options table is pretty expensive computationally, and we have limited ability to tune that performance. Especially once we're injecting unknown userland code into the pipeline, and running it on on the author's request, on any number of a priori unknown events. Similarly, if a user is in the middle of choosing a value, and options suddenly change, that would be quite jarring.
- How to handle an option being lost that the user had configured? What if the value the user chose is no longer acceptable? Currently we snap user values to defaults if they seem to be out of the acceptable range defined by the author. If that happens in the middle of e.g. combat, then it would seem (and I think rightfully so) like a bug to a user.
- It is a guarantee that the
aura_env.config
table will never be unexpectedly changed (that is, betweeninit
and any other custom code,aura_env.config
and any data it holds is always constant). In order to maintain that invariant (which many people rely on), we will be forced to completely refresh the aura, and flaginit
to run again, if we detect that the options provided by custom code have changed. I don't want to do that, for both performance and functionality reasons. And breaking the invariant would be a major breaking change.
In summary, yes it would be nice for it to magically work out like you wanted, but I don't think it's worth attempting at this point.