Quantcast

- Removed old flasks and elixirs from auto-fill

F. Dekker [03-28-13 - 18:45]
- Removed old flasks and elixirs from auto-fill
- Added show stacks in buffs to show the stacks size of buffs and debuffs
Filename
Localization.enUS.lua
PerfectRaid_Buffs.lua
PerfectRaid_IncomingHeals.lua
diff --git a/Localization.enUS.lua b/Localization.enUS.lua
index df35232..b5a18a7 100644
--- a/Localization.enUS.lua
+++ b/Localization.enUS.lua
@@ -129,6 +129,7 @@ PerfectRaidLocals = {
 	["STATUS_BLESSINGSALVATION"] = "BoS",
 	["STATUS_BLESSINGSANCTUARY"] = "BoSn",
 	["STATUS_BLESSINGWISDOM"] = "BoW",
+	["STATUS_COMMANDINGSHOUT"] = "CS",
 	["STATUS_CURSE"] = "Cu",
 	["STATUS_DISEASE"] = "Di",
 	["STATUS_DIVINESPIRIT"] = "Spi",
@@ -136,7 +137,10 @@ PerfectRaidLocals = {
 	["STATUS_FEARWARD"] = "FW",
 	["STATUS_FOOD"] = "Foo",
 	["STATUS_FORT"] = "F",
+	["STATUS_GRACEOFAIR"] = "GoA",
+	["STATUS_IMPBLOODPACT"] = "Bp",
 	["STATUS_INNERVATE"] = "Inn",
+	["STATUS_LEGACYOFTHEEMPEROR"] = "LoE",
 	["STATUS_LIFEBLOOM"] = "Lb",
 	["STATUS_MAGIC"] = "Ma",
 	["STATUS_MORTALSTRIKE"] = "Ms",
diff --git a/PerfectRaid_Buffs.lua b/PerfectRaid_Buffs.lua
index 166d3c4..5ee85f2 100644
--- a/PerfectRaid_Buffs.lua
+++ b/PerfectRaid_Buffs.lua
@@ -156,6 +156,8 @@ local buffcache = {}
 local mybuffs = {}
 local mymask = {}
 local buffexpiry = {}
+local buffstacks = {}
+local mystacks = {}

 local BIT_CURSE = 1
 local BIT_MAGIC = 2
@@ -175,17 +177,23 @@ function Buffs:UNIT_AURA(event, unit)
 	if not frames[unit] then return end

 	for k,v in pairs(buffcache) do buffcache[k] = nil end
+	for k,v in pairs(buffstacks) do buffstacks[k] = nil end
 	for k,v in pairs(mybuffs) do mybuffs[k] = nil end
+	for k,v in pairs(mystacks) do mystacks[k] = nil end
+	for k,v in pairs(buffexpiry) do buffexpiry[k] = nil end
+

 	for i=1,40 do
 		local name,rank,texture,count,dispelType,duration,expires,caster,stealable = UnitBuff(unit, i)
 		if not name then break end
 		if caster == "player" then
 			mybuffs[name] = true
+			mystacks[name] = (mystacks[name] or 0) + count
 			buffexpiry[name] = expires
 		end

 		buffcache[name] = (buffcache[name] or 0) + 1
+		buffstacks[name] = (buffstacks[name] or 0) + count
 	end

 	local debuffType
@@ -194,10 +202,12 @@ function Buffs:UNIT_AURA(event, unit)
 		if not name and not dispelType then break end

 		buffcache[name] = (buffcache[name] or 0) + 1
+		buffstacks[name] = (buffstacks[name] or 0) + count
 		buffexpiry[name] = expires

 		if dispelType and name ~= dispelType then
 			buffcache[dispelType] = (buffcache[dispelType] or 0) + 1
+			buffstacks[dispelType] = (buffstacks[dispelType] or 0) + count
 			debuffType = dispelType
 		end
 	end
@@ -312,9 +322,15 @@ end
 function Buffs:CreateBuffEntry(buffname, entry)
 	local expires = buffexpiry[buffname]
 	local num = buffcache[buffname]
+	local stacks = buffstacks[buffname]
 	local mine = mybuffs[buffname]

-	if num and num > 1 and not entry.onlymine then
+	-- show only my stacks
+	if entry.onlymine then
+		stacks = mystacks[buffname]
+	end
+
+	if ( ( num and num > 1 ) or ( stacks and stacks > 1 ) ) and not entry.onlymine then
 		local num = num
 		-- If the buff is mine, and it should be masked
 		-- A buff is masked when there is a "mine" filter set for it
@@ -322,16 +338,26 @@ function Buffs:CreateBuffEntry(buffname, entry)
 			num = num - 1
 		end

-		if (expires and entry.showexpiry) then
-			work[#work + 1] = string.format("%s(%d)(%d)", entry.colortext, num, -1 * (GetTime() - expires))
-		else
+		if (expires and entry.showexpiry) and (stacks > 1 and entry.showstacks) then
+			work[#work + 1] = string.format("%s(%d,%d)", entry.colortext, stacks, -1 * (GetTime()-expires) )
+		elseif (stacks and stacks > 1 and entry.showstacks) then
+			work[#work + 1] = string.format("%s(%d)", entry.colortext, stacks )
+		elseif ( num and expires and entry.showexpiry) then
+			work[#work + 1] = string.format("%s(%d,%d)", entry.colortext, num, -1 * (GetTime() - expires))
+		elseif ( num and num > 1 ) then
 			work[#work + 1] = string.format("%s(%d)", entry.colortext, num)
+		else
+			work[#work + 1] = string.format("%s", entry.colortext)
 		end
 	else
 		if (entry.onlymine and not mine) or (not entry.onlymine and mymask[buffname]) then
 			-- Don't show
 		else
-			if (expires and entry.showexpiry) then
+			if (expires and entry.showexpiry) and (stacks > 1 and entry.showstacks) then
+				work[#work + 1] = string.format("%s(%d,%d)", entry.colortext, stacks, -1 * (GetTime()-expires) )
+			elseif (stacks and stacks > 1 and entry.showstacks) then
+				work[#work + 1] = string.format("%s(%d)", entry.colortext, stacks )
+			elseif (expires and entry.showexpiry) then
 				work[#work + 1] = string.format("%s(%d)", entry.colortext, -1 * (GetTime()-expires))
 			else
 				work[#work + 1] = entry.colortext
@@ -682,29 +708,35 @@ function Buffs:CreateEditFrame(parent)
 	missing:Show()
 	frame.missing = missing

-	local disabled = CreateFrame("CheckButton", "PRBuffs_Disabled", PROptions_Buffs_Edit, "PRCheckTemplate")
-	disabled.Label:SetText(L["Do not check this buff (Disable)"])
-	disabled:SetPoint("BOTTOMLEFT", missing, "TOPLEFT", 0, 10)
-	disabled:Show()
-	frame.disabled = disabled
-
 	local strict = CreateFrame("CheckButton", "PRBuffs_Strict", PROptions_Buffs_Edit, "PRCheckTemplate")
 	strict.Label:SetText(L["Make filters strict"])
-	strict:SetPoint("TOPLEFT", disabled, "TOPRIGHT", 200, 0)
+	strict:SetPoint("BOTTOMLEFT", missing, "TOPLEFT", 0, 0)
 	strict:Show()
 	frame.strict = strict
+
+	local disabled = CreateFrame("CheckButton", "PRBuffs_Disabled", PROptions_Buffs_Edit, "PRCheckTemplate")
+	disabled.Label:SetText(L["Do not check this buff (Disable)"])
+	disabled:SetPoint("BOTTOMLEFT", strict, "TOPLEFT", 0, 0)
+	disabled:Show()
+	frame.disabled = disabled

 	local onlymine = CreateFrame("CheckButton", "PRBuffs_OnlyMine", PROptions_Buffs_Edit, "PRCheckTemplate")
 	onlymine.Label:SetText(L["Only show my buffs"])
-	onlymine:SetPoint("TOPLEFT", strict, "BOTTOMLEFT", 0, -10)
+	onlymine:SetPoint("TOPLEFT", disabled, "TOPRIGHT", 200, 0)
 	onlymine:Show()
 	frame.onlymine = onlymine

 	local showexpiry = CreateFrame("CheckButton", "PRBuffs_ShowExpiry", PROptions_Buffs_Edit, "PRCheckTemplate")
 	showexpiry.Label:SetText(L["Show expiry"])
-	showexpiry:SetPoint("TOPLEFT", strict, "TOPRIGHT", 150, 0)
+	showexpiry:SetPoint("TOPLEFT", strict, "TOPRIGHT", 200, 0)
 	showexpiry:Show()
 	frame.showexpiry = showexpiry
+
+	local showstacks = CreateFrame("CheckButton", "PRBuffs_ShowStacks", PROptions_Buffs_Edit, "PRCheckTemplate")
+	showstacks.Label:SetText(L["Show stacks"])
+	showstacks:SetPoint("TOPLEFT", missing, "TOPRIGHT", 200, 0)
+	showstacks:Show()
+	frame.showstacks = showstacks

 	local dropdown = CreateFrame("Frame", "PRBuffs_Dropdown", PROptions_Buffs_Edit, "UIDropDownMenuTemplate")
 	dropdown:SetID(1)
@@ -742,6 +774,7 @@ function Buffs:FillEntry(entry)
 	options.disabled:SetChecked(entry.disabled)
 	options.strict:SetChecked(entry.strict)
 	options.onlymine:SetChecked(entry.onlymine)
+	options.showstacks:SetChecked(entry.showstacks)
 	options.showexpiry:SetChecked(entry.showexpiry)
 end

@@ -810,6 +843,7 @@ function Buffs:AddEntry()
 	options.disabled:SetChecked(false)
 	options.strict:SetChecked(false)
 	options.onlymine:SetChecked(false)
+	options.showstacks:SetChecked(false)
 	options.showexpiry:SetChecked(false)
 	options.buffname:SetFocus()
 end
@@ -844,6 +878,7 @@ function Buffs:UpdateBuffTable()
 			tbl.strict = entry.strict
 			tbl.cond = {string.split(",", entry.conds)}
 			tbl.onlymine = entry.onlymine
+			tbl.showstacks = entry.showstacks
 			tbl.showexpiry = entry.showexpiry

 			if tbl.onlymine then
@@ -913,6 +948,7 @@ function Buffs:SaveEntry()
 	entry.disabled = frame.disabled:GetChecked()
 	entry.strict = frame.strict:GetChecked()
 	entry.onlymine = frame.onlymine:GetChecked()
+	entry.showstacks = frame.showstacks:GetChecked()
 	entry.showexpiry = frame.showexpiry:GetChecked()

 	local color = utils.RGBPercToHex(frame.disptext:GetTextColor())
@@ -1247,7 +1283,7 @@ Buffs.defaults = {
 		groupname2 = L["Commanding Shout"],
 		groupname3 = L["Qiraji Fortitude"],
 		disptext = L["STATUS_IMPBLOODPACT"],
-		color = "FFFFFF",
+		color = "C90404",
 		missing = true,
 		disabled = (class ~= "WARLOCK"),
 	},
@@ -1259,7 +1295,7 @@ Buffs.defaults = {
 		groupname2 = L["Power Word: Fortitude"],
 		groupname3 = L["Qiraji Fortitude"],
 		disptext = L["STATUS_COMMANDINGSHOUT"],
-		color = "FFFFFF",
+		color = "FFBF00",
 		missing = true,
 		disabled = (class ~= "WARRIOR"),
 	},
@@ -1310,148 +1346,5 @@ Buffs.defaults = {
 		buffname = L["Drink"],
 		disptext = L["STATUS_DRINK"],
 		color = "00a1de",
-	},
-	-- WOTLK Battle Elixirs
-	{
-		conds = "All",
-		buffname = L["Elixir of Accuracy"],
-		disptext = L["STATUS_BATTLE_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Elixir of Armor Piercing"],
-		disptext = L["STATUS_BATTLE_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Elixir of Deadly Strikes"],
-		disptext = L["STATUS_BATTLE_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Elixir of Expertise"],
-		disptext = L["STATUS_BATTLE_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Elixir of Lightning Speed"],
-		disptext = L["STATUS_BATTLE_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Elixir of Mighty Agility"],
-		disptext = L["STATUS_BATTLE_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Elixir of Mighty Strength"],
-		disptext = L["STATUS_BATTLE_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Guru's Elixir"],
-		disptext = L["STATUS_BATTLE_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Spellpower Elixir"],
-		disptext = L["STATUS_BATTLE_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Wrath Elixir"],
-		disptext = L["STATUS_BATTLE_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	-- WOTLK Guardian Elixirs
-	{
-		conds = "All",
-		buffname = L["Elixir of Mighty Defense"],
-		disptext = L["STATUS_GUARDIAN_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Elixir of Spirit"],
-		disptext = L["STATUS_GUARDIAN_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Elixir of Protection"],
-		disptext = L["STATUS_GUARDIAN_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Elixir of Mighty Thoughts"],
-		disptext = L["STATUS_GUARDIAN_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Elixir of Mighty Mageblood"],
-		disptext = L["STATUS_GUARDIAN_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Elixir of Mighty Fortitude"],
-		disptext = L["STATUS_GUARDIAN_ELIXIR"],
-		color = "FF0000",
-        disabled = true,
-	},
-	-- WOTLK Flasks
-	{
-		conds = "All",
-		buffname = L["Flask of the Frost Wyrm"],
-		disptext = L["STATUS_FLASK"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Flask of Stoneblood"],
-		disptext = L["STATUS_FLASK"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Flask of Pure Mojo"],
-		disptext = L["STATUS_FLASK"],
-		color = "FF0000",
-        disabled = true,
-	},
-	{
-		conds = "All",
-		buffname = L["Flask of Endless Rage"],
-		disptext = L["STATUS_FLASK"],
-		color = "FF0000",
-        disabled = true,
-	},
+	}
 }
diff --git a/PerfectRaid_IncomingHeals.lua b/PerfectRaid_IncomingHeals.lua
index 885185f..dffe2f6 100644
--- a/PerfectRaid_IncomingHeals.lua
+++ b/PerfectRaid_IncomingHeals.lua
@@ -72,7 +72,7 @@ function IncomingHeals:UpdateButtonLayout( button )
 	button.absorbbar:SetPoint("BOTTOMRIGHT", button.rightbox, "BOTTOMLEFT", 0, 1)
 	button.absorbbar:SetStatusBarTexture("Interface\\AddOns\\PerfectRaid\\images\\smooth")
 	button.absorbbar:SetFrameLevel( button.healthbar:GetFrameLevel()-2 )
-	button.absorbbar:SetStatusBarColor( 0.83, 0.45, 0.09 )
+	button.absorbbar:SetStatusBarColor( 0, 0.651, 0.871 )
 	button.absorbbar:Hide()

 end