Quantcast

Merge remote-tracking branch 'origin/shared-buffs' into panoramix

F. Dekker [03-28-13 - 16:49]
Merge remote-tracking branch 'origin/shared-buffs' into panoramix
Filename
PerfectRaid.lua
PerfectRaid_Buffs.lua
PerfectRaid_Frames.lua
diff --git a/PerfectRaid.lua b/PerfectRaid.lua
index 8cc4dcf..17d4359 100644
--- a/PerfectRaid.lua
+++ b/PerfectRaid.lua
@@ -309,6 +309,7 @@ function PerfectRaid:UNIT_HEALTH(event, unit)
 	local perc = UnitHealthMax(unit) / health
 	local class = select(2, UnitClass(unit))
 	local perc = (health/max) or 0
+	local hasaggro = false

 	if deficit > 999 then
 		deficit = string.format("%.1fk", deficit / 1000)
@@ -322,7 +323,8 @@ function PerfectRaid:UNIT_HEALTH(event, unit)
 			deficit = "|cFFFF1111"..L["Aggro"]
 		else
 			deficit = "|cFFFF1111"..deficit.."|r"
-		end
+		end
+		hasaggro = true
 	end

 	if UnitIsDead(unit) or UnitIsGhost(unit) or not UnitIsConnected(unit) then
@@ -389,6 +391,8 @@ function PerfectRaid:UNIT_HEALTH(event, unit)
 			frame.healthbar:SetValue(value)
 			if options.deficit then
 				frame.status:SetText(deficit)
+			elseif hasaggro then
+				frame.status:SetText("|cFFFF1111"..L["Aggro"])
 			else
 				frame.status:SetText(nil)
 			end
diff --git a/PerfectRaid_Buffs.lua b/PerfectRaid_Buffs.lua
index 52048ed..166d3c4 100644
--- a/PerfectRaid_Buffs.lua
+++ b/PerfectRaid_Buffs.lua
@@ -251,8 +251,14 @@ function Buffs:UNIT_AURA(event, unit)
 			buffname = entry.buffname
 		elseif buffcache[entry.groupname or "nil"] then
 			buffname = entry.groupname
+		elseif buffcache[entry.groupname2 or "nil"] then
+			buffname = entry.groupname2
+		elseif buffcache[entry.groupname3 or "nil"] then
+			buffname = entry.groupname3
+		elseif buffcache[entry.groupname4 or "nil"] then
+			buffname = entry.groupname4
 		end
-
+
 		-- How many stacks are there?
 		local class = select(2, UnitClass(unit))
 		local conds = self.conditions
@@ -468,22 +474,53 @@ function Buffs:CreateEditFrame(parent)
 	buffname:Show()
 	frame.buffname = buffname

-	local groupname = CreateFrame("EditBox", name.."GroupName", frame, "InputBoxTemplate")
-	local font = groupname:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
-	font:SetText(L["Group Buff Name:"])
-	font:SetPoint("BOTTOMLEFT", groupname, "TOPLEFT", 0, 3)
-	groupname:SetPoint("TOPLEFT", 220, -10)
-	groupname:SetAutoFocus(nil)
-	groupname:SetWidth(180)
-	groupname:SetHeight(20)
-	groupname:Show()
-	frame.groupname = groupname
+	local groupname1 = CreateFrame("EditBox", name.."GroupName", frame, "InputBoxTemplate")
+	local groupname2 = CreateFrame("EditBox", name.."GroupName2", frame, "InputBoxTemplate")
+	local groupname3 = CreateFrame("EditBox", name.."GroupName3", frame, "InputBoxTemplate")
+	local groupname4 = CreateFrame("EditBox", name.."GroupName4", frame, "InputBoxTemplate")
+	local font = groupname1:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
+
+	-- label
+	font:SetText(L["Buffs that share the same effect:"])
+	font:SetPoint("BOTTOMLEFT", groupname1, "TOPLEFT", 0, 3)
+
+	-- share/group name 1
+	groupname1:SetPoint("TOPLEFT", 230, -10)
+	groupname1:SetAutoFocus(nil)
+	groupname1:SetWidth(200)
+	groupname1:SetHeight(20)
+	groupname1:Show()
+	frame.groupname1 = groupname1
+
+	-- share/group name 2
+	groupname2:SetPoint("TOPLEFT", groupname1, "BOTTOMLEFT", 0, -2)
+	groupname2:SetAutoFocus(nil)
+	groupname2:SetWidth(200)
+	groupname2:SetHeight(20)
+	groupname2:Show()
+	frame.groupname2 = groupname2
+
+	-- share/group name 3
+	groupname3:SetPoint("TOPLEFT", groupname2, "BOTTOMLEFT", 0, -2)
+	groupname3:SetAutoFocus(nil)
+	groupname3:SetWidth(200)
+	groupname3:SetHeight(20)
+	groupname3:Show()
+	frame.groupname3 = groupname3
+
+	-- share/group name 4
+	groupname4:SetPoint("TOPLEFT", groupname3, "BOTTOMLEFT", 0, -2)
+	groupname4:SetAutoFocus(nil)
+	groupname4:SetWidth(200)
+	groupname4:SetHeight(20)
+	groupname4:Show()
+	frame.groupname4 = groupname4

 	local disptext = CreateFrame("EditBox", name.."DispText", frame, "InputBoxTemplate")
 	local font = disptext:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
 	font:SetText(L["Display Text:"])
 	font:SetPoint("BOTTOMLEFT", disptext, "TOPLEFT", 0, 3)
-	disptext:SetPoint("TOPLEFT", 0, -50)
+	disptext:SetPoint("TOPLEFT", 0, -54)
 	disptext:SetAutoFocus(nil)
 	disptext:SetWidth(180)
 	disptext:SetHeight(20)
@@ -568,9 +605,12 @@ function Buffs:CreateEditFrame(parent)
 	swatch:SetScript("OnEnter", colorSwatchOnEnter);
 	swatch:SetScript("OnClick", colorSwatchOnClick);

-	buffname:SetScript("OnTabPressed", function() if IsShiftKeyDown() then disptext:SetFocus() else groupname:SetFocus() end end)
-	groupname:SetScript("OnTabPressed", function() if IsShiftKeyDown() then buffname:SetFocus() else disptext:SetFocus() end end)
-	disptext:SetScript("OnTabPressed", function() if IsShiftKeyDown() then groupname:SetFocus() else buffname:SetFocus() end end)
+	buffname:SetScript("OnTabPressed", function() if IsShiftKeyDown() then disptext:SetFocus() else groupname1:SetFocus() end end)
+	groupname1:SetScript("OnTabPressed", function() if IsShiftKeyDown() then buffname:SetFocus() else groupname2:SetFocus() end end)
+	groupname2:SetScript("OnTabPressed", function() if IsShiftKeyDown() then groupname1:SetFocus() else groupname3:SetFocus() end end)
+	groupname3:SetScript("OnTabPressed", function() if IsShiftKeyDown() then groupname2:SetFocus() else groupname4:SetFocus() end end)
+	groupname4:SetScript("OnTabPressed", function() if IsShiftKeyDown() then groupname3:SetFocus() else disptext:SetFocus() end end)
+	disptext:SetScript("OnTabPressed", function() if IsShiftKeyDown() then groupname4:SetFocus() else buffname:SetFocus() end end)

 	local function makeCheck(value)
 		local button = CreateFrame("CheckButton", "PRBuffCond_"..value, PROptions_Buffs_Edit, "PRCheckTemplate")
@@ -585,42 +625,42 @@ function Buffs:CreateEditFrame(parent)
 	-- Build condition checkboxes

 	checks[1] = makeCheck(self.conditions[1])
-	checks[1]:SetPoint("TOPLEFT", disptext, "BOTTOMLEFT", 0, -20)
+	checks[1]:SetPoint("TOPLEFT", disptext, "BOTTOMLEFT", 0, -40)
 	checks[1]:Show()

 	for i=2,6 do
 		checks[i] = makeCheck(self.conditions[i])
-		checks[i]:SetPoint("TOPLEFT", checks[i-1], "TOPRIGHT", 60, 0)
+		checks[i]:SetPoint("TOPLEFT", checks[i-1], "TOPRIGHT", 75, 0)
 		checks[i]:Show()
 	end

 	checks[7] = makeCheck(self.conditions[7])
-	checks[7]:SetPoint("TOPLEFT", checks[1], "BOTTOMLEFT", 0, -10)
+	checks[7]:SetPoint("TOPLEFT", checks[1], "BOTTOMLEFT", 0, -5)
 	checks[7]:Show()

 	for i=8,12 do
 		checks[i] = makeCheck(self.conditions[i])
-		checks[i]:SetPoint("TOPLEFT", checks[i-1], "TOPRIGHT", 60, 0)
+		checks[i]:SetPoint("TOPLEFT", checks[i-1], "TOPRIGHT", 75, 0)
 		checks[i]:Show()
 	end

 	checks[13] = makeCheck(self.conditions[13])
-	checks[13]:SetPoint("TOPLEFT", checks[7], "BOTTOMLEFT", 0, -10)
+	checks[13]:SetPoint("TOPLEFT", checks[7], "BOTTOMLEFT", 0, -5)
 	checks[13]:Show()

 	for i=14,18 do
 		checks[i] = makeCheck(self.conditions[i])
-		checks[i]:SetPoint("TOPLEFT", checks[i-1], "TOPRIGHT", 60, 0)
+		checks[i]:SetPoint("TOPLEFT", checks[i-1], "TOPRIGHT", 75, 0)
 		checks[i]:Show()
 	end

 	checks[19] = makeCheck(self.conditions[19])
-	checks[19]:SetPoint("TOPLEFT", checks[13], "BOTTOMLEFT", 0, -10)
+	checks[19]:SetPoint("TOPLEFT", checks[13], "BOTTOMLEFT", 0, -5)
 	checks[19]:Show()

 	for i=20,22 do
 		checks[i] = makeCheck(self.conditions[i])
-		checks[i]:SetPoint("TOPLEFT", checks[i-1], "TOPRIGHT", 60, 0)
+		checks[i]:SetPoint("TOPLEFT", checks[i-1], "TOPRIGHT", 75, 0)
 		checks[i]:Show()
 	end

@@ -678,7 +718,10 @@ end
 function Buffs:FillEntry(entry)
 	local options = PROptions_Buffs_Edit
 	options.buffname:SetText(entry.buffname)
-	options.groupname:SetText(entry.groupname or "")
+	options.groupname1:SetText(entry.groupname or "")
+	options.groupname2:SetText(entry.groupname2 or "")
+	options.groupname3:SetText(entry.groupname3 or "")
+	options.groupname4:SetText(entry.groupname4 or "")
 	options.disptext:SetText(entry.disptext)
 	options.disptext:SetTextColor(utils.HexToRGBPerc(entry.color))
 	PRColorSelect.normalTexture:SetVertexColor(utils.HexToRGBPerc(entry.color))
@@ -752,7 +795,10 @@ function Buffs:AddEntry()
 	self.options:FadeOut(PROptions_Buffs)
 	self.options:FadeIn(options)
 	options.buffname:SetText("")
-	options.groupname:SetText("")
+	options.groupname1:SetText("")
+	options.groupname2:SetText("")
+	options.groupname3:SetText("")
+	options.groupname4:SetText("")
 	options.disptext:SetText("")
 	options.disptext:SetTextColor(1,1,1)
 	PRColorSelect.normalTexture:SetVertexColor(1,1,1)
@@ -790,6 +836,9 @@ function Buffs:UpdateBuffTable()
 			local tbl = {}
 			tbl.buffname = entry.buffname
 			tbl.groupname = entry.groupname
+			tbl.groupname2 = entry.groupname2
+			tbl.groupname3 = entry.groupname3
+			tbl.groupname4 = entry.groupname4
 			tbl.colortext = "|cFF"..entry.color..tostring(entry.disptext).."|r"
 			tbl.missing = entry.missing
 			tbl.strict = entry.strict
@@ -817,7 +866,10 @@ function Buffs:SaveEntry()
 	local frame = PROptions_Buffs_Edit

 	local buffname = frame.buffname:GetText()
-	local groupname = frame.groupname:GetText()
+	local groupname1 = frame.groupname1:GetText()
+	local groupname2 = frame.groupname2:GetText()
+	local groupname3 = frame.groupname3:GetText()
+	local groupname4 = frame.groupname4:GetText()
 	local disptext = frame.disptext:GetText()

 	local err
@@ -833,15 +885,19 @@ function Buffs:SaveEntry()
 		return
 	end

-	if groupname == "" then
-		groupname = nil
-	end
+	if groupname1 == "" then groupname1 = nil end
+	if groupname2 == "" then groupname2 = nil end
+	if groupname3 == "" then groupname3 = nil end
+	if groupname4 == "" then groupname4 = nil end

 	local options = PROptions_Buffs_Edit
 	local entry = options.editEntry or {}

 	entry.buffname = buffname
-	entry.groupname = groupname
+	entry.groupname = groupname1
+	entry.groupname2 = groupname2
+	entry.groupname3 = groupname3
+	entry.groupname4 = groupname4
 	entry.disptext = disptext

 	local work = {}
@@ -997,10 +1053,13 @@ local class = select(2, UnitClass("player"))
 local race = select(2, UnitRace("player"))

 Buffs.defaults = {
+	-- Priest
 	{
 		conds = "All",
 		buffname = L["Power Word: Fortitude"],
-		groupname = L["Prayer of Fortitude"],
+		groupname = L["Imp: Blood Pact"],
+		groupname2 = L["Commanding Shout"],
+		groupname3 = L["Qiraji Fortitude"],
 		disptext = L["STATUS_FORT"],
 		color = "FFFFFF",
 		missing = true,
@@ -1070,7 +1129,9 @@ Buffs.defaults = {
 	{
 		conds = "All",
 		buffname = L["Mark of the Wild"],
-		groupname = L["Gift of the Wild"],
+		groupname = L["Blessing of Kings"],
+		groupname2 = L["Legacy of the Emperor"],
+		groupname3 = L["Embrace of the Shale Spider"],
 		disptext = L["STATUS_MOTW"],
 		color = "BC64AA",
 		missing = true,
@@ -1089,6 +1150,7 @@ Buffs.defaults = {
 		buffname = L["Lifebloom"],
 		disptext = L["STATUS_LIFEBLOOM"],
 		color = "50fe37",
+		showexpiry = true,
 		disabled = (class ~= "DRUID"),
 	},
 	{
@@ -1098,14 +1160,7 @@ Buffs.defaults = {
 		color = "00FF10",
         showexpiry = true,
 		disabled = (class ~= "DRUID"),
-	},
-	{
-		conds = "All",
-		buffname = L["Thorns"],
-		disptext = L["STATUS_THORNS"],
-		color = "aa6644",
-		disabled = (class ~= "DRUID"),
-	},
+	},
 	{
 		conds = "Mana",
 		buffname = L["Innervate"],
@@ -1118,66 +1173,61 @@ Buffs.defaults = {
 		disptext = L["STATUS_WILD_GROWTH"],
 		color = "01796F",
 	},
-	-- Paladin Buffs
-	{
-		conds = "Melee",
-		buffname = L["Blessing of Might"],
-		groupname = L["Greater Blessing of Might"],
-		disptext = L["STATUS_BLESSINGMIGHT"],
-		color = "F48CBA",
-		missing = true,
-		disabled = (class ~= "PALADIN"),
-	},
-	{
-		conds = "Mana",
-		buffname = L["Blessing of Wisdom"],
-		groupname = L["Greater Blessing of Wisdom"],
-		disptext = L["STATUS_BLESSINGWISDOM"],
-		color = "F48CBA",
-		missing = true,
-		disabled = (class ~= "PALADIN"),
-	},
-	{
-		conds = "NonTank",
-		buffname = L["Blessing of Salvation"],
-		groupname = L["Greater Blessing of Salvation"],
-		disptext = L["STATUS_BLESSINGSALVATION"],
-		color = "F48CBA",
-		missing = true,
-		disabled = (class ~= "PALADIN"),
-	},
+	-- Shaman
 	{
 		conds = "All",
-		buffname = L["Blessing of Light"],
-		groupname = L["Greater Blessing of Light"],
-		disptext = L["STATUS_BLESSINGLIGHT"],
+		buffname = L["Grace of Air"],
+		groupname = L["Blessing of Might"],
+		groupname2 = L["Roar of Courage"],
+		groupname3 = L["Spirit Beast Blessing"],
+		disptext = L["STATUS_GRACEOFAIR"],
 		color = "F48CBA",
 		missing = true,
-		disabled = (class ~= "PALADIN"),
-	},
+		disabled = (class ~= "SHAMAN"),
+	},
+	-- Paladin Buffs
 	{
 		conds = "All",
-		buffname = L["Blessing of Sanctuary"],
-		groupname = L["Greater Blessing of Sanctuary"],
-		disptext = L["STATUS_BLESSINGSANCTUARY"],
+		buffname = L["Blessing of Might"],
+		groupname = L["Grace of Air"],
+		groupname2 = L["Roar of Courage"],
+		groupname3 = L["Spirit Beast Blessing"],
+		disptext = L["STATUS_BLESSINGMIGHT"],
 		color = "F48CBA",
 		missing = true,
 		disabled = (class ~= "PALADIN"),
-	},
+	},
 	{
 		conds = "All",
 		buffname = L["Blessing of Kings"],
-		groupname = L["Greater Blessing of Kings"],
+		groupname = L["Mark of the Wild"],
+		groupname2 = L["Legacy of the Emperor"],
+		groupname3 = L["Embrace of the Shale Spider"],
 		disptext = L["STATUS_BLESSINGKINGS"],
 		color = "F48CBA",
 		missing = true,
 		disabled = (class ~= "PALADIN"),
 	},
+	-- Monk buffs
+	{
+		conds = "All",
+		buffname = L["Legacy of the Emperor"],
+		groupname = L["Blessing of Kings"],
+		groupname2 = L["Mark of the Wild"],
+		groupname3 = L["Embrace of the Shale Spider"],
+		disptext = L["STATUS_LEGACYOFTHEEMPEROR"],
+		color = "01796F",
+		missing = true,
+		disabled = (class ~= "MONK"),
+	},
 	-- Mage Buffs
 	{
 		conds = "Mana",
-		buffname = L["Arcane Intellect"],
-		groupname = L["Arcane Brilliance"],
+		buffname = L["Arcane Brilliance"],
+		groupname = L["Dalaran Brilliance"],
+		groupname2 = L["Burning Wrath"],
+		groupname3 = L["Dark Intent"],
+		groupname4 = L["Still Water"],
 		disptext = L["STATUS_ARCANEINT"],
 		color = "3399FF",
 		missing = true,
@@ -1190,6 +1240,29 @@ Buffs.defaults = {
 		disptext = L["STATUS_SOULSTONE"],
 		color = "CA21FF",
 	},
+	{
+		conds = "All",
+		buffname = L["Imp: Blood Pact"],
+		groupname = L["Power Word: Fortitude"],
+		groupname2 = L["Commanding Shout"],
+		groupname3 = L["Qiraji Fortitude"],
+		disptext = L["STATUS_IMPBLOODPACT"],
+		color = "FFFFFF",
+		missing = true,
+		disabled = (class ~= "WARLOCK"),
+	},
+	-- Warrior
+	{
+		conds = "All",
+		buffname = L["Commanding Shout"],
+		groupname = L["Imp: Blood Pact"],
+		groupname2 = L["Power Word: Fortitude"],
+		groupname3 = L["Qiraji Fortitude"],
+		disptext = L["STATUS_COMMANDINGSHOUT"],
+		color = "FFFFFF",
+		missing = true,
+		disabled = (class ~= "WARRIOR"),
+	},
 	-- Misc Debuffs
 	{
 		conds = "All",
diff --git a/PerfectRaid_Frames.lua b/PerfectRaid_Frames.lua
index 083fa56..0b8eaad 100644
--- a/PerfectRaid_Frames.lua
+++ b/PerfectRaid_Frames.lua
@@ -210,6 +210,7 @@ function Frames:CreateEditFrame(parent)
 		UIDropDownMenu_AddButton{text = L["None"], value = -1, func = clickFunc}
 		UIDropDownMenu_AddButton{text = L["Group"], value = "GROUP", func = clickFunc}
 		UIDropDownMenu_AddButton{text = L["Class"], value = "CLASS", func = clickFunc}
+		UIDropDownMenu_AddButton{text = L["Role"],  value = "ROLE",  func = clickFunc}
 	end
 	groupByDropDown:SetScript("OnShow", function(f)
 		UIDropDownMenu_Initialize(PRFrames_GroupByDropDown, groupByDropDown.Initialize)