Quantcast

.

F. Dekker [04-22-13 - 18:08]
.
Filename
PerfectRaid_Roles.lua
diff --git a/PerfectRaid_Roles.lua b/PerfectRaid_Roles.lua
index 4b5842e..e0495d8 100644
--- a/PerfectRaid_Roles.lua
+++ b/PerfectRaid_Roles.lua
@@ -73,21 +73,33 @@ function RaidRoles:UpdateAllUnits()

 			for frame in pairs( frames[unit] ) do

+				local parent = frame:GetParent()
+				local options = PerfectRaid.db.profile.headers[parent.idx]
+
 				-- create indicator and texture
 				if (not frame.raidrole) then
 					frame.raidrole = CreateFrame("Frame", nil, frame.leftbox)
 					frame.raidrole:SetHeight(frame:GetHeight() * 0.75)
 					frame.raidrole:SetWidth(frame:GetHeight() * 0.75)
 					frame.raidrole:SetFrameLevel(frame.leftbox:GetFrameLevel()+1)
-					frame.raidrole:SetParent(frame.leftbox)

 					frame.raidroletex = frame.raidrole:CreateTexture(nil, "OVERLAY")
 					frame.raidroletex:SetAllPoints()
 					frame.raidroletex:SetTexture("Interface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES")
 				end
-
-				frame.raidrole:ClearAllPoints()
-				frame.raidrole:SetPoint("RIGHT", -3-frame.name:GetWidth(), 0)
+
+				-- position frame according to align
+				if options.alignright then
+					frame.raidrole:ClearAllPoints()
+					frame.raidrole:SetParent(frame.rightbox)
+					frame.raidrole:SetPoint("TOPRIGHT", 0, 0)
+
+				else
+					frame.raidrole:ClearAllPoints()
+					frame.raidrole:SetParent(frame.leftbox)
+					frame.raidrole:SetPoint("TOPLEFT", 0, 0)
+				end
+

 				if ( showRoles and showTank and role == "TANK" ) then
 					frame.raidroletex:SetTexCoord(0, 19/64, 22/64, 41/64)