From 58b2734536c28f153ac1c71da47b0a2d7ae9c5b6 Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Fri, 20 Nov 2009 16:46:36 -0600 Subject: [PATCH] Added backend option to hide modifier key hints in the tooltip --- Upgrade.lua | 11 +++++++++++ WeightsWatcher.lua | 8 ++++---- defaults.lua | 3 ++- 3 files changed, 17 insertions(+), 5 deletions(-) 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("") 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("") 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("") 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("") 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", -- 1.7.9.5