Open InfusOnWoW opened 1 year ago
Just to clarify on the specific strategy I had been going for, the dynamic group asks for each child (on the usual activate/state change), 'where' they want to be distributed to
self
, unit
, nameplate
, etc, to anchor to the dgroup region, a unit frame, a nameplate, etc self
, this only makes sense to be nil
or the WA nil special (an empty string), but for unit
a unitId would be the obvious choicesome considerations to deal with:
In such a container approach, having the anchor point (TOP, CENTER, BOTTOMRIGHT, etc) be part of the container identifier might also be valuable. For example, a user could wish to create a dynamic group which tracked specific buffs and debuffs in an encounter, and anchors the buffs to TOPLEFT (growing right), while debuffs are anchored to BOTTOMLEFT (also growing right).
Whenever a state changes, we essentially iterate over all regions to sort/grow them.
We can optimize that by introducing another abstraction, which iirc was part of the dg2 work by rivers.
That is introuce the concept of a "container", that handles the sorting/layout of all regions that are attached to the same frame and provides api to add/remove regions to themselve.
So if a state changes: If the region stays in the ame container we only need to sort/layout that container. And otherwise remove it from the previous container and add it to the next.