Quantcast

* Added a disable button for buffs/debuffs, making it easier to turn them off and on

James Whitehead II [01-25-08 - 09:06]
* Added a disable button for buffs/debuffs, making it easier to turn them off and on
* Added tooltip for the raid frames tab, so you can see the full list of options/filters
* Raid Frames tab now shows which options (showParty, showRaid, showPlayer, showSolo) are checked
Filename
Localization.enUS.lua
PerfectRaid_Buffs.lua
PerfectRaid_Frames.lua
PerfectRaid_Options.lua
diff --git a/Localization.enUS.lua b/Localization.enUS.lua
index a33b7e6..53aa1dd 100644
--- a/Localization.enUS.lua
+++ b/Localization.enUS.lua
@@ -1,6 +1,7 @@
 --Localization.enUS.lua

 PerfectRaidLocals = {
+	[" *** DISABLED ***"] = " *** DISABLED ***",
 	["Add"] = "Add",
 	["Adding a default raid layout to new profile \"%s\""] = "Adding a default raid layout to new profile \"%s\"",
 	["Adding default buffs to new profile \"%s\""] = "Adding default buffs to new profile \"%s\"",
@@ -149,7 +150,11 @@ PerfectRaidLocals = {
 	["Warrior"] = "Warrior",
 	["Weakened Soul"] = "Weakened Soul",
 	["You must select at least one class or group to display."] = "You must select at least one class or group to display.",
+	["inParty"] = "inParty",
+	["inRaid"] = "inRaid",
 	["lock - Lock frames"] = "lock - Lock frames",
+	["showPlayer"] = "showPlayer",
+	["showSolo"] = "showSolo",
 	["unlock - Unlock frames"] = "unlock - Unlock frames",
 }

diff --git a/PerfectRaid_Buffs.lua b/PerfectRaid_Buffs.lua
index 3fa3cfa..770e09f 100644
--- a/PerfectRaid_Buffs.lua
+++ b/PerfectRaid_Buffs.lua
@@ -273,10 +273,16 @@ function Buffs:CreateOptions(opt)
 			if idx <= #list then
 				local entry = list[idx]
 				local display = entry.buffname
+
 				if entry.groupname then
 					display = display .. "/"..entry.groupname
 				end
 				display = display .. " (|cFF"..entry.color..entry.disptext.."|r)"
+
+				if entry.disabled then
+					display = display .. L[" *** DISABLED ***"]
+				end
+
 				button.line1:SetText(display)
 				button:Show()
 				if options.selected == idx then
@@ -327,10 +333,15 @@ function Buffs:CreateOptions(opt)
 	add:SetScript("OnClick", function() self:AddEntry() end)
 	add:Show()

+	local disable = CreateFrame("Button", "PRBuffs_Disable", options, "PRButtonTemplate")
+	disable:SetText(L["Disable"])
+	disable:SetPoint("BOTTOMRIGHT", add, "BOTTOMLEFT", -10, 0)
+	disable:SetScript("OnClick", function() self:DisableEntry() end)
+	disable:Show()
+
 	self:CreateEditFrame(options)
 end

-
 function Buffs:CreateEditFrame(parent)
 	local frame = CreateFrame("Frame", "PROptions_Buffs_Edit", PROptions)
 	local name = "PROptions_Buffs_Edit"
@@ -584,6 +595,18 @@ function Buffs:EditEntry()
 	self:FillEntry(entry)
 end

+function Buffs:DisableEntry()
+	local scrollframe = PROptions_BuffsScrollFrame
+	local offset = FauxScrollFrame_GetOffset(scrollframe)
+	local selected = PROptions_Buffs.selected
+	local idx = offset + selected
+	local entry = PerfectRaid.db.profile.buffs[idx]
+	entry.disabled = not entry.disabled
+	scrollframe.update()
+	self:EnableButtons()
+	self:UpdateBuffTable()
+end
+
 function Buffs:AddEntry()
 	local options = PROptions_Buffs_Edit
 	self.options:FadeOut(PROptions_Buffs)
@@ -705,9 +728,23 @@ function Buffs:EnableButtons()
 	if selected then
 		PRBuffs_Edit:Enable()
 		PRBuffs_Delete:Enable()
+		PRBuffs_Disable:Enable()
+
+		-- Change enable/disable
+		local scrollframe = PROptions_BuffsScrollFrame
+		local offset = FauxScrollFrame_GetOffset(scrollframe)
+		local selected = PROptions_Buffs.selected
+		local idx = offset + selected
+		local entry = PerfectRaid.db.profile.buffs[idx]
+		if entry.disabled then
+			PRBuffs_Disable:SetText(L["Enable"])
+		else
+			PRBuffs_Disable:SetText(L["Disable"])
+		end
 	else
 		PRBuffs_Edit:Disable()
 		PRBuffs_Delete:Disable()
+		PRBuffs_Disable:Disable()
 	end
 end

diff --git a/PerfectRaid_Frames.lua b/PerfectRaid_Frames.lua
index b9ad65e..acb33ee 100644
--- a/PerfectRaid_Frames.lua
+++ b/PerfectRaid_Frames.lua
@@ -92,12 +92,27 @@ function Frames:CreateOptions(opt)
 			button = scrollframe.entries[i]
 			if idx <= #list then
 				local entry = list[idx]
+				local work = {}
+
+				if entry.showParty then table.insert(work, L["inParty"]) end
+				if entry.showRaid then table.insert(work, L["inRaid"]) end
+				if entry.showPlayer then table.insert(work, L["showPlayer"]) end
+				if entry.showSolo then table.insert(work, L["showSolo"]) end
+				local flags = string.join(",", unpack(work))
+
+				if #flags > 0 then
+					flags = flags .. ","
+				end
+
 				local display
 				if entry.title then
-					display = string.format("%s%s: %s", entry.disabled and L["Disabled: "] or "", entry.title, entry.filter or L["No filters selected"])
+					display = string.format("%s%s: %s%s", entry.disabled and L["Disabled: "] or "", entry.title, flags, entry.filter or L["No filters selected"])
 				else
-					display = string.format("%s%s", entry.disabled and L["Disabled: "] or "", entry.filter or L["No filters selected"])
+					display = string.format("%s%s%s", entry.disabled and L["Disabled: "] or "", flags, entry.filter or L["No filters selected"])
 				end
+
+				button.tooltip = "This frame has the following options/filters set:\n" .. display:gsub(",", ", ")
+
 				button.line1:SetText(display)
 				button:Show()
 				if PROptions_Frames.selected == idx then
diff --git a/PerfectRaid_Options.lua b/PerfectRaid_Options.lua
index cb8f19e..a9417fd 100644
--- a/PerfectRaid_Options.lua
+++ b/PerfectRaid_Options.lua
@@ -163,6 +163,17 @@ function Options:CreateListFrame(parent, num)
 		parent.selected = idx
 	end

+	local function OnEnter(self)
+		if self.tooltip then
+			GameTooltip_SetDefaultAnchor(GameTooltip, self);
+			GameTooltip:SetText(self.tooltip)
+		end
+	end
+
+	local function OnLeave(self)
+		GameTooltip:Hide()
+	end
+
 	local function MakeEntry(name, parent)
 		local entry = CreateFrame("CheckButton", name, parent)
 		entry:SetScript("OnClick", OnClick)
@@ -175,6 +186,9 @@ function Options:CreateListFrame(parent, num)
 		entry.line1:SetPoint("LEFT", 0 ,0)
 		entry.line1:SetPoint("RIGHT", -5, 0)
 		entry.line1:SetJustifyH("LEFT")
+
+		entry:SetScript("OnEnter", OnEnter)
+		entry:SetScript("OnLeave", OnLeave)
 		return entry
 	end