Quantcast

* Finished up the "Config" tab, which is a general options tab. The hide party thing may or may not work :P

James Whitehead II [01-25-08 - 16:12]
* Finished up the "Config" tab, which is a general options tab.  The hide party thing may or may not work :P
Filename
PerfectRaid.lua
PerfectRaid_Config.lua
PerfectRaid_Options.lua
diff --git a/PerfectRaid.lua b/PerfectRaid.lua
index bb5e182..e4308d0 100644
--- a/PerfectRaid.lua
+++ b/PerfectRaid.lua
@@ -61,6 +61,7 @@ function PerfectRaid:Initialize()
 			hideparty = true,
 			showmanaonly = true,
 			clickcast = true,
+			locked = false,
 			highlight = {
 				mouseover = true,
 				tooltip = false,
@@ -192,7 +193,7 @@ end

 local function OnDragStart(frame)
 	local parent = frame.dragparent
-	if not PerfectRaid.db.profile.Locked then
+	if not PerfectRaid.db.profile.locked then
 		parent:StartMoving()
 		PerfectRaid.moving = parent
 	end
@@ -603,8 +604,11 @@ function PerfectRaid.ConfigureButton(button)

 	button:SetAttribute("initial-width", 225)
 	button:SetAttribute("initial-height", 14)
-
-	ClickCastFrames[button] = true
+
+	if self.db.profile.clickcast then
+		ClickCastFrames[button] = true
+	end
+
 	button:SetAttribute("*type1", "target")

 	local bg = button:CreateTexture(nil, "BACKGROUND")
diff --git a/PerfectRaid_Config.lua b/PerfectRaid_Config.lua
index 8b83d25..51612a0 100644
--- a/PerfectRaid_Config.lua
+++ b/PerfectRaid_Config.lua
@@ -78,24 +78,27 @@ function Config:CreateOptions(opt)
 	save:Show()

 	function options:SaveOptions()
-		local mouseover = PRHighlight_Mouseover:GetChecked() and true or false
-		local tooltip = PRHighlight_Tooltip:GetChecked() and true or false
-		local disease = PRHighlight_Disease:GetChecked() and true or false
-		local curse = PRHighlight_Curse:GetChecked() and true or false
-		local magic = PRHighlight_Magic:GetChecked() and true or false
-		local poison = PRHighlight_Poison:GetChecked() and true or false
-
-		PerfectRaid.db.profile.highlight.mouseover = mouseover
-		PerfectRaid.db.profile.highlight.tooltip = tooltip
-		PerfectRaid.db.profile.highlight.disease = disease
-		PerfectRaid.db.profile.highlight.curse = curse
-		PerfectRaid.db.profile.highlight.magic = magic
-		PerfectRaid.db.profile.highlight.poison = poison
+		local hideParty = PRConfig_HideParty:GetChecked() and true or false
+		local showMana = PRConfig_ShowManaOnly:GetChecked() and true or false
+		local clickCast = PRConfig_ClickCast:GetChecked() and true or false
+		local locked = PRConfig_Lock:GetChecked() and true or false
+
+		PerfectRaid.db.profile.hideparty = hideParty
+		PerfectRaid.db.profile.showmanaonly = showMana
+		PerfectRaid.db.profile.clickcast = clickCast
+		PerfectRaid.db.profile.locked = locked
 	end

 	function options:CancelOptions()
+		PRConfig_HideParty:SetChecked(PerfectRaid.db.profile.hideparty)
+		PRConfig_ShowManaOnly:SetChecked(PerfectRaid.db.profile.showmanaonly)
+		PRConfig_ClickCast:SetChecked(PerfectRaid.db.profile.clickcast)
+		PRConfig_Lock:SetChecked(PerfectRaid.db.profile.locked)
 	end

+	options:SetScript("OnShow", function() options:CancelOptions() end)
+	options:Hide()
+
 	for idx,widget in ipairs(options.widgets) do
 		widget:Show()
 		if idx == 1 then
diff --git a/PerfectRaid_Options.lua b/PerfectRaid_Options.lua
index d4d1504..60530ba 100644
--- a/PerfectRaid_Options.lua
+++ b/PerfectRaid_Options.lua
@@ -46,13 +46,13 @@ end
 function Options:LockFrames()
 	local profile = PerfectRaid.db.profile
 	self:Print(L["Frames have been locked"])
-	profile.Locked = true
+	profile.locked = true
 end

 function Options:UnlockFrames()
 	local profile = PerfectRaid.db.profile
 	self:Print(L["Frames have been unlocked"])
-	profile.Locked = false
+	profile.locked = false
 end

 function Options:ShowOptions()