Thanks. Currently I'm making specifically raid frames (or party frames if I'm in party) based on SecureGroupHeaderTemplate and they seem to work with OnAttributeChanged way. If someone joins, each unit frame updates with new unit, if someone leaves, last frame updates with null unit, etc. At least from my limited testing with some people joining and leaving. Here's my snippet:
Lua Code:
function MyFrames_UnitTemplate_OnAttributeChanged(self, attributeName)
if attributeName == "unit" then
local unit = self:GetAttribute("unit");
if unit == nil then
self:UnregisterAllEvents();
else
self.name:SetText(UnitName(unit));
updateBarTextures(self, unit);
self:RegisterUnitEvent("UNIT_ABSORB_AMOUNT_CHANGED", unit);
self:RegisterUnitEvent("UNIT_HEAL_ABSORB_AMOUNT_CHANGED", unit);
self:RegisterUnitEvent("UNIT_HEAL_PREDICTION", unit);
self:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", unit);
self:RegisterUnitEvent("UNIT_MAXHEALTH", unit);
end
end
end
PS UNIT_HEALTH_FREQUENT is so weird. Combat log events arriving 200-300 ms earlier than UNIT_HEALTH_FREQUENT so parsing combat log would make unit frames a bit more responsive, but it's quite a headache, why WoW implemented this way I just don't understand, it's not even about throttling, a single npc swinging me every few seconds still shows the same lag between combat log event and UNIT_HEALTH_FREQUENT event. And with heals this problem is not present, I'm receiving UNIT_HEALTH_FREQUENT exactly at the same time as heal combat log event.