View Single Post
08-18-13, 12:01 AM   #3
nishay77
A Murloc Raider
Join Date: Aug 2013
Posts: 8
Thanks for the reply. I am completely new at using LUA so my code is a bit noobish. I am not hooking into my raid frames, but rather I have 10 separate frames, one on top of each unit frame to keep track of that player's buff.

So I start with XML UI frames:
Code:
<Button name="TotalAbsorbsR1" parent="UIParent" enableMouse="false" movable="false" frameStrata="MEDIUM">
		<Size x="50" y="10"/>
		<Anchors>
			<Anchor point="TOP" relativePoint="CENTER" relativeTo="ElvUF_Raid10Group1UnitButton1">
				<Offset x="-2" y="-5"/>
			</Anchor>
		</Anchors>
		<Layers>
			<Layer level="OVERLAY">
			<FontString name="$parentText" inherits="GameFontNormalSmall" justifyH="CENTER" setAllPoints="true" text=""/>
			</Layer>
		</Layers>
	</Button>
I made 10 of these and anchored each one (just a FontString) to each ElvUI raid frame.

Then, I have a list of frames that I made and a list of corresponding units

Code:
unitlist = {"target", "player", "raid1", "raid2", etc..}
buttonlist = {"TotalAbsorbsTar", "TotalAbsorbsSelf", "TotalAbsorbsR1", etc..}
Now on UNIT_AURA event trigger, I loop through all units from "unitlist" and update the FontString with the new value. So when I update "raid1", then "TotalAbsorbsR1" is updated with that value. (obviously this is inefficient, but right now I am just focused on fixing my current problem)

So when I am in a raid and I move, for example, the raid leader from group 1 to group 2, he is now associated with Group2Spot1 in my raid frames and "TotalAbsorbsR6" frame in my addon. Therefore, his UnitId should be "raid6". However, his UnitId is still "raid1". So now my addon will update unit "raid1" and post it to "TotalAbsorbsR1", which has a different person.

How can I check which unit is occupying a specific raid frame. Or if you have another suggestion, I would love to hear it.

Thank you for the help!
  Reply With Quote