View Single Post
01/28/22, 05:42 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
I think there is no existing vanilla mapping between group unitTags and their names/rawNames. Some events at groups may fire both, not sure.
At best have a look at the ESOUI source code -> group to see what vanilla ZOs code does:
https://github.com/esoui/esoui/tree/...i/ingame/group

First question:
"OnUpdate"? Why not filling and removing entries in your group dict table at the event_group_joined / left callbacks as the group members join and leave your group? They do not need to be re-added or removed each n milliseconds so an OnUpdate is not needed afai understand.
You should be easily able to loop over all grouped players and update your dictionary as these events trigger.

Hints:
I understand that you use the combat event to compare the group's unitTag with the event's name or rawName (or vice versa)?
Should work with your method then, yes. In your OnUpdate, which should only be active within combat or certain cases then to make it performant, you can compare your dictionary of grouped names with the combat event's unitTag.

You should definately add event filters to that combat events then, e.g. the REGISTER_FILTER_COMBAT_RESULT, the group prefix REGISTER_FILTER_UNIT_TAG_PREFIX "group", and if you know the abilityId of that casted buff also use REGISTER_FILTER_ABILITY_ID
https://wiki.esoui.com/AddFilterForEvent


And you should define local pointer variables to your tables to speed up the access to them, e.g.
Else the code will "each time" search _G table for DynamicRO, then it will search the table DynamicRO for GroupDict and so on.
If you use a local pointing to a table, updates on that local will update the table properly (add/remove).

Lua Code:
  1. local groupMemberName = GetRawUnitName("group" .. i)
  2. local groupDict = DynamicRO.GroupDict
  3. groupDict ["group" .. i] = groupMemberName
  4. groupDict [groupMemberName] = "group" .. i

Last edited by Baertram : 01/28/22 at 05:47 PM.
  Reply With Quote