Quantcast

Some unit aura and basic frame adjustments

Steven Jackson [03-13-15 - 00:23]
Some unit aura and basic frame adjustments
Filename
SVUI_!Core/setup/installer.lua
SVUI_!Core/setup/presets.lua
SVUI_!Options/UnitFrames.lua
SVUI_TrackOMatic/SVUI_TrackOMatic.lua
SVUI_UnitFrames/Loader.lua
SVUI_UnitFrames/SVUI_UnitFrames.lua
SVUI_UnitFrames/elements/essentials.lua
SVUI_UnitFrames/frames.lua
diff --git a/SVUI_!Core/setup/installer.lua b/SVUI_!Core/setup/installer.lua
index cd1d8cd..399c3ca 100644
--- a/SVUI_!Core/setup/installer.lua
+++ b/SVUI_!Core/setup/installer.lua
@@ -151,8 +151,10 @@ local function UFMoveBottomQuadrant(toggle)

 	SV:ReAnchor("SVUI_Player", "BOTTOM", SV.Screen, "BOTTOM", -x, y);
 	SV:ReAnchor("SVUI_PlayerCastbar", "BOTTOM", SV.Screen, "BOTTOM", -x, y-60);
+	SV:ReAnchor("SVUI_Pet", "RIGHT", SVUI_Player, "LEFT", -2, 0);
 	SV:ReAnchor("SVUI_Target", "BOTTOM", SV.Screen, "BOTTOM", x, y);
 	SV:ReAnchor("SVUI_TargetCastbar", "BOTTOM", SV.Screen, "BOTTOM", x, y-60);
+	SV:ReAnchor("SVUI_TargetTarget", "LEFT", SVUI_Target, "RIGHT", 2, 0);
 	SV:ReAnchor("SVUI_Focus", "BOTTOM", SV.Screen, "BOTTOM", x2, y2);
 	SV:ReAnchor("SVUI_ThreatBar", "BOTTOMRIGHT", SV.Screen, "BOTTOMRIGHT", -x3, y3);
 end
diff --git a/SVUI_!Core/setup/presets.lua b/SVUI_!Core/setup/presets.lua
index dddbf7f..4307bc0 100644
--- a/SVUI_!Core/setup/presets.lua
+++ b/SVUI_!Core/setup/presets.lua
@@ -524,7 +524,7 @@ local function LoadPresetData()
 				},
 				["targettarget"] = {
 					portrait = {
-						enable = false,
+						enable = true,
 						overlay = true,
 						style = "3DOVERLAY",
 					},
diff --git a/SVUI_!Options/UnitFrames.lua b/SVUI_!Options/UnitFrames.lua
index 6e25ac3..2ba6b68 100644
--- a/SVUI_!Options/UnitFrames.lua
+++ b/SVUI_!Options/UnitFrames.lua
@@ -2393,14 +2393,20 @@ SV.Options.args[Schema] = {
 									desc = L["A convenient meter for tanks to display their current resolve."],
 									type = "toggle"
 								},
-								spacer99 = {
+								infoBackgrounds = {
 									order = 6,
+									name = L["Info Backgrounds"],
+									desc = L["Show or hide the gradient under each of the four main unitframes. (Player, Target, Pet, Target of Target)"],
+									type = "toggle"
+								},
+								spacer99 = {
+									order = 7,
 									name = "",
 									type = "description",
 									width = "full",
 								},
 								OORAlpha = {
-									order = 7,
+									order = 8,
 									name = L["Range Fading"],
 									desc = L["The transparency of units that are out of range."],
 									type = "range",
@@ -2412,7 +2418,7 @@ SV.Options.args[Schema] = {
 									end
 								},
 								groupOORAlpha = {
-									order = 8,
+									order = 9,
 									name = L["Group Range Fading"],
 									desc = L["The transparency of group units that are out of range."],
 									type = "range",
diff --git a/SVUI_TrackOMatic/SVUI_TrackOMatic.lua b/SVUI_TrackOMatic/SVUI_TrackOMatic.lua
index 820f92b..4536381 100644
--- a/SVUI_TrackOMatic/SVUI_TrackOMatic.lua
+++ b/SVUI_TrackOMatic/SVUI_TrackOMatic.lua
@@ -308,8 +308,8 @@ function PLUGIN:Load()

         if(TRACKER_TARGET) then
             UNIT_TRACKER:SetParent(TRACKER_TARGET)
-            UNIT_TRACKER:SetPoint("LEFT", TRACKER_TARGET, "RIGHT", 2, 0)
         end
+        UNIT_TRACKER:SetPoint("CENTER", UIParent, "CENTER", 0, -200)

         self:RegisterEvent("PLAYER_TARGET_CHANGED")
     end
diff --git a/SVUI_UnitFrames/Loader.lua b/SVUI_UnitFrames/Loader.lua
index 923d060..11be3aa 100644
--- a/SVUI_UnitFrames/Loader.lua
+++ b/SVUI_UnitFrames/Loader.lua
@@ -87,6 +87,7 @@ SV.defaults[Schema] = {
 	["themed"] = true,
 	["disableBlizzard"] = true,
 	["smoothbars"] = false,
+	["infoBackgrounds"] = true,
 	["statusbar"] = "SVUI MultiColorBar",
 	["auraBarStatusbar"] = "SVUI MultiColorBar",
 	["font"] = "SVUI Number Font",
@@ -502,8 +503,8 @@ SV.defaults[Schema] = {
 		["enable"] = true,
 		["rangeCheck"] = true,
 		["threatEnabled"] = false,
-		["width"] = 150,
-		["height"] = 25,
+		["width"] = 110,
+		["height"] = 40,
 		["formatting"] = {
 			["power_colored"] = true,
 			["power_type"] = "none",
diff --git a/SVUI_UnitFrames/SVUI_UnitFrames.lua b/SVUI_UnitFrames/SVUI_UnitFrames.lua
index 712f693..744ef2f 100644
--- a/SVUI_UnitFrames/SVUI_UnitFrames.lua
+++ b/SVUI_UnitFrames/SVUI_UnitFrames.lua
@@ -417,6 +417,18 @@ function MOD:RefreshUnitLayout(frame, template)
 		end
 	end

+	if(frame.InfoPanelBG) then
+		if(SV.db.UnitFrames.infoBackgrounds) then
+			frame.InfoPanelBG:SetTexture(1,1,1,1)
+			frame.InfoPanelLeft:SetTexture(1,1,1,1)
+			frame.InfoPanelRight:SetTexture(1,1,1,1)
+		else
+			frame.InfoPanelBG:SetTexture(0,0,0,0)
+			frame.InfoPanelLeft:SetTexture(0,0,0,0)
+			frame.InfoPanelRight:SetTexture(0,0,0,0)
+		end
+	end
+
 	--[[ THREAT LAYOUT ]]--

 	if frame.Threat then
@@ -659,7 +671,9 @@ function MOD:RefreshUnitLayout(frame, template)
 				PORTRAIT_GRIP:ModPoint(TOP_ANCHOR2, frame, TOP_ANCHOR2, (1 * TOP_MODIFIER), -1)
 				PORTRAIT_GRIP:ModPoint(BOTTOM_ANCHOR2, MASTER_GRIP, BOTTOM_ANCHOR1, (1 * BOTTOM_MODIFIER), 1)
 			end
+
 			if(PORTRAIT.ForceUpdate) then PORTRAIT:ForceUpdate() end
+
 			PORTRAIT_GRIP:Show()
 		else
 			PORTRAIT_GRIP:Hide()
@@ -757,109 +771,6 @@ function MOD:RefreshUnitLayout(frame, template)

 	--[[ AURA LAYOUT ]]--

-	if(BUFF_GRIP) then
-		local rows 		= db.buffs.numrows;
-		local columns 	= db.buffs.perrow;
-		local count 	= columns * rows;
-		local auraSize;
-
-		if(BUFF_GRIP.Bars and BUFF_GRIP.Icons) then
-			BUFF_GRIP.UseBars = db.buffs.useBars or false;
-			--if(template == 'player') then print(db.buffs.useBars) end
-			if(BUFF_GRIP.UseBars and (BUFF_GRIP.UseBars == true)) then
-				auraSize = db.buffs.barSize;
-				count = db.buffs.barCount;
-				if(db.buffs.anchorPoint == "BELOW") then
-					BUFF_GRIP.down = true
-				else
-					BUFF_GRIP.down = false
-				end
-				--if(template == 'player') then print('WIPING BUFF ICONS') end
-				for i = 1, #BUFF_GRIP.Icons do
-					BUFF_GRIP.Icons[i]:Hide()
-				end
-			else
-				--if(template == 'player') then print('WIPING BUFF BARS') end
-				for i = 1, #BUFF_GRIP.Bars do
-					BUFF_GRIP.Bars[i]:Hide()
-				end
-			end
-		end
-
-		if(not auraSize) then
-			if(db.buffs.sizeOverride and db.buffs.sizeOverride > 0) then
-				auraSize = db.buffs.sizeOverride
-			else
-				local tempSize = (((UNIT_WIDTH + 2) - (DEBUFF_GRIP.spacing * (columns - 1))) / columns);
-				auraSize = min(BEST_SIZE, tempSize)
-			end
-		end
-
-		BUFF_GRIP.auraSize  	= auraSize;
-		BUFF_GRIP.maxCount 		= GRID_MODE and 0 or count;
-		BUFF_GRIP.maxRows 		= rows;
-		BUFF_GRIP.maxColumns 	= columns;
-		BUFF_GRIP.forceShow 	= frame.forceShowAuras;
-
-		local attachTo = FindAnchorFrame(frame, db.buffs.attachTo, db.debuffs.attachTo == 'BUFFS' and db.buffs.attachTo == 'DEBUFFS')
-		BUFF_GRIP:ClearAllPoints()
-		SV:SetReversePoint(BUFF_GRIP, db.buffs.anchorPoint, attachTo, db.buffs.xOffset + BOTTOM_MODIFIER, db.buffs.yOffset)
-		BUFF_GRIP["growth-y"] = db.buffs.verticalGrowth;
-		BUFF_GRIP["growth-x"] = db.buffs.horizontalGrowth;
-		BUFF_GRIP:SetSorting(db.buffs.sort)
-	end
-
-	if(DEBUFF_GRIP) then
-		local rows 		= db.debuffs.numrows;
-		local columns 	= db.debuffs.perrow;
-		local count 	= columns * rows;
-		local auraSize;
-
-		if(DEBUFF_GRIP.Bars and DEBUFF_GRIP.Icons) then
-			DEBUFF_GRIP.UseBars = db.debuffs.useBars or false;
-			if(DEBUFF_GRIP.UseBars and (DEBUFF_GRIP.UseBars == true)) then
-				auraSize = db.debuffs.barSize;
-				count = db.debuffs.barCount;
-				if(db.debuffs.anchorPoint == "BELOW") then
-					DEBUFF_GRIP.down = true
-				else
-					DEBUFF_GRIP.down = false
-				end
-				--if(template == 'player') then print('WIPING DEBUFF ICONS') end
-				for i = 1, #DEBUFF_GRIP.Icons do
-					DEBUFF_GRIP.Icons[i]:Hide()
-				end
-			else
-				--if(template == 'player') then print('WIPING DEBUFF BARS') end
-				for i = 1, #DEBUFF_GRIP.Bars do
-					DEBUFF_GRIP.Bars[i]:Hide()
-				end
-			end
-		end
-
-		if(not auraSize) then
-			if(db.debuffs.sizeOverride and db.debuffs.sizeOverride > 0) then
-				auraSize = db.debuffs.sizeOverride
-			else
-				local tempSize = (((UNIT_WIDTH + 2) - (DEBUFF_GRIP.spacing * (columns - 1))) / columns);
-				auraSize = min(BEST_SIZE, tempSize)
-			end
-		end
-
-		DEBUFF_GRIP.auraSize  	= auraSize;
-		DEBUFF_GRIP.maxRows 	= rows;
-		DEBUFF_GRIP.maxColumns 	= columns;
-		DEBUFF_GRIP.maxCount 	= GRID_MODE and 0 or count;
-		DEBUFF_GRIP.forceShow 	= frame.forceShowAuras;
-
-		local attachTo = FindAnchorFrame(frame, db.debuffs.attachTo, db.debuffs.attachTo == 'BUFFS' and db.buffs.attachTo == 'DEBUFFS')
-		DEBUFF_GRIP:ClearAllPoints()
-		SV:SetReversePoint(DEBUFF_GRIP, db.debuffs.anchorPoint, attachTo, db.debuffs.xOffset + BOTTOM_MODIFIER, db.debuffs.yOffset)
-		DEBUFF_GRIP["growth-y"] = db.debuffs.verticalGrowth;
-		DEBUFF_GRIP["growth-x"] = db.debuffs.horizontalGrowth;
-		DEBUFF_GRIP:SetSorting(db.debuffs.sort)
-	end
-
 	if(BUFF_GRIP or DEBUFF_GRIP) then
 		if((not BUFF_ENABLED) and (not DEBUFF_ENABLED)) then
 			if(frame:IsElementEnabled('Aura')) then
@@ -871,13 +782,129 @@ function MOD:RefreshUnitLayout(frame, template)
 			if(not frame:IsElementEnabled('Aura')) then
 				frame:EnableElement('Aura')
 			end
-			if(BUFF_ENABLED) then
-				BUFF_GRIP:Show()
-				BUFF_GRIP:ForceUpdate()
+			if(BUFF_GRIP) then
+				if(BUFF_ENABLED) then
+					BUFF_GRIP:Show()
+
+					local rows 		= db.buffs.numrows;
+					local columns 	= db.buffs.perrow;
+					local count 	= columns * rows;
+					local auraSize;
+
+					if(BUFF_GRIP.Bars and BUFF_GRIP.Icons) then
+						BUFF_GRIP.UseBars = db.buffs.useBars or false;
+						--if(template == 'player') then print(db.buffs.useBars) end
+						if(BUFF_GRIP.UseBars and (BUFF_GRIP.UseBars == true)) then
+							auraSize = db.buffs.barSize;
+							count = db.buffs.barCount;
+							if(db.buffs.anchorPoint == "BELOW") then
+								BUFF_GRIP.down = true
+							else
+								BUFF_GRIP.down = false
+							end
+							--if(template == 'player') then print('WIPING BUFF ICONS') end
+							for i = 1, #BUFF_GRIP.Icons do
+								BUFF_GRIP.Icons[i]:Hide()
+							end
+						else
+							--if(template == 'player') then print('WIPING BUFF BARS') end
+							for i = 1, #BUFF_GRIP.Bars do
+								BUFF_GRIP.Bars[i]:Hide()
+							end
+						end
+					end
+
+					if(not auraSize) then
+						if(db.buffs.sizeOverride and db.buffs.sizeOverride > 0) then
+							auraSize = db.buffs.sizeOverride
+						else
+							local tempSize = (((UNIT_WIDTH + 2) - (DEBUFF_GRIP.spacing * (columns - 1))) / columns);
+							auraSize = min(BEST_SIZE, tempSize)
+						end
+					end
+
+					BUFF_GRIP.auraSize  	= auraSize;
+					BUFF_GRIP.maxCount 		= GRID_MODE and 0 or count;
+					BUFF_GRIP.maxRows 		= rows;
+					BUFF_GRIP.maxColumns 	= columns;
+					BUFF_GRIP.forceShow 	= frame.forceShowAuras;
+
+					local attachTo = db.buffs.attachTo;
+					if(attachTo == 'DEBUFFS' and (not DEBUFF_ENABLED)) then
+						attachTo = 'FRAME'
+					end
+
+					local attachAnchor = FindAnchorFrame(frame, attachTo, attachTo == 'DEBUFFS' and db.debuffs.attachTo == 'BUFFS')
+					BUFF_GRIP:ClearAllPoints()
+					SV:SetReversePoint(BUFF_GRIP, db.buffs.anchorPoint, attachAnchor, db.buffs.xOffset + BOTTOM_MODIFIER, db.buffs.yOffset)
+					BUFF_GRIP["growth-y"] = db.buffs.verticalGrowth;
+					BUFF_GRIP["growth-x"] = db.buffs.horizontalGrowth;
+					BUFF_GRIP:SetSorting(db.buffs.sort)
+					BUFF_GRIP:ForceUpdate()
+				else
+					BUFF_GRIP:Hide()
+				end
 			end
-			if(DEBUFF_ENABLED) then
-				DEBUFF_GRIP:Show()
-				DEBUFF_GRIP:ForceUpdate()
+			if(DEBUFF_GRIP) then
+				if(DEBUFF_ENABLED) then
+					DEBUFF_GRIP:Show()
+					local rows 		= db.debuffs.numrows;
+					local columns 	= db.debuffs.perrow;
+					local count 	= columns * rows;
+					local auraSize;
+
+					if(DEBUFF_GRIP.Bars and DEBUFF_GRIP.Icons) then
+						DEBUFF_GRIP.UseBars = db.debuffs.useBars or false;
+						if(DEBUFF_GRIP.UseBars and (DEBUFF_GRIP.UseBars == true)) then
+							auraSize = db.debuffs.barSize;
+							count = db.debuffs.barCount;
+							if(db.debuffs.anchorPoint == "BELOW") then
+								DEBUFF_GRIP.down = true
+							else
+								DEBUFF_GRIP.down = false
+							end
+							--if(template == 'player') then print('WIPING DEBUFF ICONS') end
+							for i = 1, #DEBUFF_GRIP.Icons do
+								DEBUFF_GRIP.Icons[i]:Hide()
+							end
+						else
+							--if(template == 'player') then print('WIPING DEBUFF BARS') end
+							for i = 1, #DEBUFF_GRIP.Bars do
+								DEBUFF_GRIP.Bars[i]:Hide()
+							end
+						end
+					end
+
+					if(not auraSize) then
+						if(db.debuffs.sizeOverride and db.debuffs.sizeOverride > 0) then
+							auraSize = db.debuffs.sizeOverride
+						else
+							local tempSize = (((UNIT_WIDTH + 2) - (DEBUFF_GRIP.spacing * (columns - 1))) / columns);
+							auraSize = min(BEST_SIZE, tempSize)
+						end
+					end
+
+					DEBUFF_GRIP.auraSize  	= auraSize;
+					DEBUFF_GRIP.maxRows 	= rows;
+					DEBUFF_GRIP.maxColumns 	= columns;
+					DEBUFF_GRIP.maxCount 	= GRID_MODE and 0 or count;
+					DEBUFF_GRIP.forceShow 	= frame.forceShowAuras;
+
+					local attachTo = db.debuffs.attachTo;
+					if(attachTo == 'BUFFS' and (not BUFF_ENABLED)) then
+						attachTo = 'FRAME'
+					end
+
+					local attachAnchor = FindAnchorFrame(frame, attachTo, attachTo == 'BUFFS' and db.buffs.attachTo == 'DEBUFFS')
+					DEBUFF_GRIP:ClearAllPoints()
+					SV:SetReversePoint(DEBUFF_GRIP, db.debuffs.anchorPoint, attachAnchor, db.debuffs.xOffset + BOTTOM_MODIFIER, db.debuffs.yOffset)
+					DEBUFF_GRIP["growth-y"] = db.debuffs.verticalGrowth;
+					DEBUFF_GRIP["growth-x"] = db.debuffs.horizontalGrowth;
+					DEBUFF_GRIP:SetSorting(db.debuffs.sort)
+					DEBUFF_GRIP:ForceUpdate()
+				else
+					DEBUFF_GRIP:Hide()
+				end
 			end
 		end
 	end
diff --git a/SVUI_UnitFrames/elements/essentials.lua b/SVUI_UnitFrames/elements/essentials.lua
index f2a3460..d32f79b 100644
--- a/SVUI_UnitFrames/elements/essentials.lua
+++ b/SVUI_UnitFrames/elements/essentials.lua
@@ -236,31 +236,30 @@ local function ADDInfoBG(frame)
 	bg:ModPoint("BOTTOMRIGHT", frame.InfoPanel, "BOTTOMRIGHT", 0, 0)
 	bg:SetTexture(1, 1, 1, 1)
 	bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 0.7)
-	frame.InfoPanel.BGTex = bg
+	frame.InfoPanelBG = bg

 	local left = frame.InfoPanel:CreateTexture(nil, "BACKGROUND")
 	left:ModPoint("TOPLEFT", frame.ActionPanel, "TOPLEFT", 0, 1)
 	left:ModPoint("BOTTOMLEFT", frame.InfoPanel, "BOTTOMLEFT", 0, 0)
 	left:SetWidth(2)
 	left:SetTexture(1, 1, 1, 1)
-	left:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 0.7)
-	frame.InfoPanel.LeftTex = left
+	left:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 1)
+	frame.InfoPanelLeft = left

 	local right = frame.InfoPanel:CreateTexture(nil, "BACKGROUND")
 	right:ModPoint("TOPRIGHT", frame.ActionPanel, "TOPRIGHT", 0, 1)
 	right:ModPoint("BOTTOMRIGHT", frame.InfoPanel, "BOTTOMRIGHT", 0, 0)
 	right:SetWidth(2)
 	right:SetTexture(1, 1, 1, 1)
-	right:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 0.7)
-	frame.InfoPanel.RightTex = right
+	right:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 1)
+	frame.InfoPanelRight = right
 end

 function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText)
 	if(frame.ActionPanel) then return; end
 	frame:SetStyle("Frame", "ActionPanel")
+	local baseSize = SV.media.shared.font.unitprimary.size / 0.48;
 	if(unit and (unit == "target" or unit == "player")) then
-		local baseSize = SV.media.shared.font.unitprimary.size / 0.55;
-
 		local info = CreateFrame("Frame", nil, frame)
 		info:SetFrameStrata("BACKGROUND")
 		info:SetFrameLevel(0)
@@ -368,13 +367,13 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText)
 				end
 			end)
 		end
-	elseif(unit == 'pet') then
+	elseif(unit and (unit == 'pet' or unit == 'targettarget')) then
 		local info = CreateFrame("Frame", nil, frame)
 		info:SetFrameStrata("BACKGROUND")
 		info:SetFrameLevel(0)
-		info:ModPoint("TOPLEFT", frame.ActionPanel, "BOTTOMLEFT", -1, 1)
-		info:ModPoint("TOPRIGHT", frame.ActionPanel, "BOTTOMRIGHT", 1, 1)
-		info:SetHeight(30)
+		info:ModPoint("TOPLEFT", frame.ActionPanel, "BOTTOMLEFT", 0, 1)
+		info:ModPoint("TOPRIGHT", frame.ActionPanel, "BOTTOMRIGHT", 0, 1)
+		info:SetHeight(baseSize)

 		frame.InfoPanel = info;
 		ADDInfoBG(frame)
diff --git a/SVUI_UnitFrames/frames.lua b/SVUI_UnitFrames/frames.lua
index 66b432e..7c4dcfb 100644
--- a/SVUI_UnitFrames/frames.lua
+++ b/SVUI_UnitFrames/frames.lua
@@ -418,7 +418,7 @@ CONSTRUCTORS["targettarget"] = function(self, unit)
     MOD:CreateAuraFrames(self, key)
     self.RaidIcon = MOD:CreateRaidIcon(self)
     self.Range = { insideAlpha = 1, outsideAlpha = 1 }
-    self:ModPoint("BOTTOM", SV.Screen, "BOTTOM", 0, 182)
+    self:ModPoint("LEFT", SVUI_Target, "RIGHT", 2, 0)
     SV:NewAnchor(self, L["TargetTarget Frame"])

     self.MediaUpdate = MOD.RefreshUnitMedia