Quantcast

* Added a disable checkbox to the buff editing window

James Whitehead II [01-02-07 - 15:58]
* Added a disable checkbox to the buff editing window
Filename
PerfectRaid.lua
PerfectRaid_Buffs.lua
diff --git a/PerfectRaid.lua b/PerfectRaid.lua
index 3b8eb72..91a70dd 100644
--- a/PerfectRaid.lua
+++ b/PerfectRaid.lua
@@ -89,6 +89,8 @@ function PerfectRaid:Enable()
 	PRHeader6:SetPoint("TOP", PRHeader5, "BOTTOM", 0, -20)
 	PRHeader7:SetPoint("TOP", PRHeader6, "BOTTOM", 0, -20)
 	PRHeader8:SetPoint("TOP", PRHeader7, "BOTTOM", 0, -20)
+	--local header = self:CreateRaidFrame("PRHeader1", "1,2,3,4,5,6,7,8", nil, nil, "CLASS", "WARRIOR,PRIEST,PALADIN,DRUID,SHAMAN,ROGUE,MAGE,WARLOCK,HUNTER", 2, 10, "LEFT")
+	--self:RestorePosition("PRHeader1")
 end

 function PerfectRaid:SavePosition(name)
@@ -159,11 +161,19 @@ function PerfectRaid:CreateRaidFrame(name, title, filter, strict, dragparent, gr
 	frame:SetAttribute("yOffset", -2)
 	frame:SetAttribute("sortMethod", "NAME")
 	frame:SetAttribute("strictFiltering", strict)
+<<<<<<< .mine
+	frame:SetAttribute("groupBy", group)
+	frame:SetAttribute("grouppingOrder", order)
+	frame:SetAttribute("maxColumns", columns)
+	frame:SetAttribute("columnSpacing", coloffset)
+	frame:SetAttribute("columnAnchorPoint", colanchor)
+=======
 	frame:SetAttribute("groupBy", group)
 	frame:SetAttribute("groupingOrder", order)
 	frame:SetAttribute("maxColumns", columns)
 	frame:SetAttribute("columnSpacing", coloffset)
 	frame:SetAttribute("columnAnchorPoint", colanchor)
+>>>>>>> .r34
 	frame.dragparent = dragparent or frame
 	frame.initialConfigFunction = PerfectRaid.ConfigureButton
 	frame:SetMovable(true)
diff --git a/PerfectRaid_Buffs.lua b/PerfectRaid_Buffs.lua
index 44cc031..c7ec0e7 100644
--- a/PerfectRaid_Buffs.lua
+++ b/PerfectRaid_Buffs.lua
@@ -448,11 +448,11 @@ function Buffs:CreateEditFrame(parent)
 	save:SetScript("OnClick", function() self:SaveEntry() end)
 	save:Show()

-	local missing = CreateFrame("CheckButton", "PRBuffs_Missing", PROptions_Buffs_Edit, "PRCheckTemplate")
-	missing.Label:SetText("Only show if this buff is missing")
-	missing:SetPoint("BOTTOMLEFT", 0, 10)
-	missing:Show()
-	frame.missing = missing
+	local disabled = CreateFrame("CheckButton", "PRBuffs_Disabled", PROptions_Buffs_Edit, "PRCheckTemplate")
+	disabled.Label:SetText("Do not check this buff (Disable)")
+	disabled:SetPoint("BOTTOMLEFT", save, "TOPLEFT", 0, 10)
+	disabled:Show()
+	frame.disabled = disabled
 end

 function Buffs:EditEntry()
@@ -484,6 +484,7 @@ function Buffs:EditEntry()
 	end

 	options.missing:SetChecked(entry.missing)
+	options.disabled:SetChecked(entry.disabled)
 end

 function Buffs:AddEntry()
@@ -499,6 +500,7 @@ function Buffs:AddEntry()
 		button:SetChecked(false)
 	end
 	options.missing:SetChecked(false)
+	options.disabled:SetChecked(false)
 	options.buffname:SetFocus()
 end

@@ -518,13 +520,15 @@ function Buffs:UpdateBuffTable()
 	for k,v in pairs(buffs) do buffs[k] = nil end

 	for idx,entry in ipairs(PerfectRaid.db.profile.buffs) do
-		local tbl = {}
-		tbl.buffname = entry.buffname
-		tbl.groupname = entry.groupname
-		tbl.colortext = "|cFF"..entry.color..entry.disptext.."|r"
-		tbl.missing = entry.missing
-		tbl.cond = {string.split(",", entry.conds)}
-		table.insert(buffs, tbl)
+		if not entry.disabled then
+			local tbl = {}
+			tbl.buffname = entry.buffname
+			tbl.groupname = entry.groupname
+			tbl.colortext = "|cFF"..entry.color..entry.disptext.."|r"
+			tbl.missing = entry.missing
+			tbl.cond = {string.split(",", entry.conds)}
+			table.insert(buffs, tbl)
+		end
 	end

 	for unit in pairs(frames) do
@@ -569,6 +573,7 @@ function Buffs:SaveEntry()
 	local conds = strjoin(",", unpack(work))
 	entry.conds = conds
 	entry.missing = frame.missing:GetChecked()
+	entry.disabled = frame.disabled:GetChecked()

 	local color = utils.RGBPercToHex(frame.disptext:GetTextColor())
 	entry.color = color
@@ -643,7 +648,6 @@ function Buffs:AddDefaultBuff(profile, entry)
 	tbl.disabled = nil
 	table.insert(profile, tbl)
 end
-

 local class = select(2, UnitClass("player"))
 local race = select(2, UnitRace("player"))