View Single Post
04-22-10, 05:39 AM   #10
Sideshow
A Flamescale Wyrmkin
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 103
Code:
for k,v in pairs(com) do
	if not com[k][5] and not com[k][6] and com[k][1] > 0 then -- if it's not a pet and there is not yet a bar and damage > 0 then make a bar
		makeBar(k)
	end
	if com[k][6] then -- if there is a bar, update value and text (the text fontstring is referenced in [7])
		com[k][6]:SetValue(com[k][1]/mostDamage*1000)
		com[k][7]:SetText(com[k][1]..' ('..ceil(com[k][1]/com[k][2])..')')
	end
end
it's an iteration to update the statusbar object for each instance of "com" (combatants for a dps meter)
as you see, "v" is never used at all, since i use integer indexes
the structure of an instance in com is made like : com[UnitGUID] = { 0, 3.5, nil, "", "", nil, nil }

Last edited by Sideshow : 04-22-10 at 05:49 AM.
  Reply With Quote