Quantcast

Added backend option to hide modifier key hints in the tooltip

Kevin Lyles [11-20-09 - 22:46]
Added backend option to hide modifier key hints in the tooltip
Filename
Upgrade.lua
WeightsWatcher.lua
defaults.lua
diff --git a/Upgrade.lua b/Upgrade.lua
index 135ab18..b578325 100644
--- a/Upgrade.lua
+++ b/Upgrade.lua
@@ -124,6 +124,15 @@ noop_down = [[
 	end
 ]]

+function upgradeAccountHideModKeyHints(vars)
+	if vars.options.tooltip.hideHints == nil then
+		vars.options.tooltip.hideHints = false
+	end
+
+	vars.dataMinorVersion = 8
+	return vars
+end
+
 function upgradeAccountShowClassNames(vars)
 	if not vars.options.tooltip.showClassNames then
 		vars.options.tooltip.showClassNames = "Others"
@@ -285,6 +294,7 @@ upgradeAccountFunctions = {
 		[4] = function(vars) return upgradeAccountToHandleModifierKeys(vars) end,
 		[5] = function(vars) return noop_up(vars) end,
 		[6] = function(vars) return upgradeAccountShowClassNames(vars) end,
+		[7] = function(vars) return upgradeAccountHideModKeyHints(vars) end,
 	},
 }

@@ -296,6 +306,7 @@ downgradeAccountFunctions = {
 		[5] = noop_down,
 		[6] = noop_down,
 		[7] = noop_down,
+		[8] = noop_down,
 	},
 }

diff --git a/WeightsWatcher.lua b/WeightsWatcher.lua
index 5579890..d848201 100644
--- a/WeightsWatcher.lua
+++ b/WeightsWatcher.lua
@@ -250,20 +250,20 @@ function WeightsWatcher:displayItemStats(tooltip, ttname)
 							end
 						end
 					end
-					if not keyDetectors[ww_vars.options.tooltip.showIdealGems]() then
+					if not ww_vars.options.tooltip.hideHints and not keyDetectors[ww_vars.options.tooltip.showIdealGems]() then
 						if ww_vars.options.tooltip.showIdealGems then
 							tooltip:AddLine("<Press " .. ww_vars.options.tooltip.showIdealGems .. " to show ideal gems>")
 						end
-					elseif not keyDetectors[ww_vars.options.tooltip.showIdealGemStats]() then
+					elseif not ww_vars.options.tooltip.hideHints and not keyDetectors[ww_vars.options.tooltip.showIdealGemStats]() then
 						if ww_vars.options.tooltip.showIdealGemStats then
 							tooltip:AddLine("<Press " .. ww_vars.options.tooltip.showIdealGemStats .. " to show ideal gem stats>")
 						end
 					end
-				elseif ww_vars.options.tooltip.showIdealWeights then
+				elseif not ww_vars.options.tooltip.hideHints and ww_vars.options.tooltip.showIdealWeights then
 					tooltip:AddLine("<Press " .. ww_vars.options.tooltip.showIdealWeights .. " to show ideal weights>")
 				end
 			end
-		elseif ww_vars.options.tooltip.showWeights then
+		elseif not ww_vars.options.tooltip.hideHints and ww_vars.options.tooltip.showWeights then
 			tooltip:AddLine("<Press " .. ww_vars.options.tooltip.showWeights .. " to show weights>")
 		end
 		tooltip:Show()
diff --git a/defaults.lua b/defaults.lua
index dd8906e..59aa8bb 100644
--- a/defaults.lua
+++ b/defaults.lua
@@ -102,7 +102,7 @@ keyDetectors = {

 defaultVars = {
 	dataMajorVersion = 0,
-	dataMinorVersion = 7,
+	dataMinorVersion = 8,
 	weightsList = {
 		[1] = "DEATHKNIGHT",
 		[2] = "DRUID",
@@ -499,6 +499,7 @@ defaultVars = {
 		gemQualityLimit = 9,
 		showClassNames = "Others",
 		tooltip = {
+			hideHints = false,
 			showWeights = true,
 			showIdealWeights = "SHIFT",
 			showIdealGems = "CTRL",