The actual plug-in structure is pretty simple.
It’s essentially just a Lua code module with the necessary logic to pick the priority action and return an event-like string that the core module will move into _G space. That is very little more than an array of functions passed back to the core module to be run in sequence with the first non-nil result stopping the run and indicating the “hit” in your rotation.
The idea is that any other addon can then make my core module a dependency and poll that _G space variable for a) existence and b) a value (best done on selected CLEU events) and flag or activate frames as necessary to indicate “do this now”.
The rotation helpers generally available in Lua all seem to work the same way - a string of icons where you pick the left-most icon, mentally translate that to what spell/ability/item it corresponds with, then find (or recall) that action’s location on your bars and activate it.
I find that whole process exhausting.
I’ve hardcoded a LOT of rotation helpers for different classes and spec in WA where what I do is either “glow” (WA’s term) the button directly with an overlay (pretty simple to set up) or replicate the hardware button layout on screen and “glow” the appropriate button there.
That works much better for me (and for a few other folks I’ve shown it to and helped them develop). What you get is not a triad of connections between icon-action-button to be deciphered, but just a visual indicator of which button to activate.
From a HUD ergonomic perspective, it’s MUCH simpler.
The problem is two-fold.
One - I don’t want to activate EVERY potential “priority” (the existing rotation helpers do that, but use position in the list to indicate which is the highest priority priority action) because I’m wanting to highlight only the highest priority action.
Two - WA has a fairly shallow limit on how deep you can stack nested logic in their “conditions” section (which is where you have to stick the “glow” action).
In order to solve those problems, I have to move the logic outside of WA and yet make it accessible.
Once I decided to do that, making it available for ANY addon to use was a small leap.
The other side of this is that there isn’t just one rotation for a given class/spec.
There are probably half a dozen viable meta or near-meta builds for each class/spec combination, especially considering racials, covenants, soulbinds, and conduits in the mix. Also, there are contextual rotational changes as well. What is best for raiding, for instance, is not always best for M+.
There isn’t any possible way for me to write a rotation sequence for every one of those combinations, particularly since I don’t play more than 2 or 3 classes myself.
Providing a relatively simple mechanism for users (including myself - if I start playing some other class/spec combos) to plug in rotational logic seems the best way to do this.
I’m going to have to reread your posts to get the full effect of them, but I think I see what you’re getting at regarding the globals and it’s why I came here. I tend to reinvent wheels that really don’t need reinventing with regards to best practices in coding.
It’s early yet and I have to get out of the house this morning for breakfast and shopping, but I’ll dig into this when I get back. It looks promising.
Thank you very much.