From f06d3e718c8e5ade49ad8c71fe2160d92d0bbaae Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Tue, 12 Jan 2010 18:40:15 -0600 Subject: [PATCH] Created a generic checkbutton template --- config.xml | 249 ++++++++++++++++++------------------------------------------ 1 file changed, 74 insertions(+), 175 deletions(-) diff --git a/config.xml b/config.xml index ebef235..ddf8551 100644 --- a/config.xml +++ b/config.xml @@ -58,6 +58,55 @@ + + + + + + + + + + + + + + + self.text:SetTextColor(0.5, 0.5, 0.5) + + + self.text:SetTextColor(1, 0.82, 0) + + + if self.ttText then + GameTooltip:SetOwner(self,"ANCHOR_RIGHT") + GameTooltip:AddLine(self.ttText, 1, 1, 1) + GameTooltip:Show() + end + + + if self.ttText then + GameTooltip:Hide() + end + + + self.text = getglobal(self:GetName() .. "Text") + self.text:SetText(self:GetText()) + self:SetChecked(self.shouldBeChecked()) + if self.shouldBeEnabled then + if self.shouldBeEnabled() then + self:Enable() + else + self:Disable() + end + end + + + @@ -140,17 +189,9 @@ - - - - + - - - - - @@ -161,33 +202,15 @@ end ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable) - - GameTooltip:SetOwner(self,"ANCHOR_RIGHT") - GameTooltip:AddLine("Consider gems that are Unique-Equipped when finding ideal gems", 1, 1, 1) - GameTooltip:Show() - - - GameTooltip:Hide() - - getglobal(self:GetName() .. "Text"):SetText(self:GetText()) + self.shouldBeChecked = function() return ww_vars.options.gems.usedTypes["Unique-Equipped"] end + self.ttText = "Consider gems that are Unique-Equipped when finding ideal gems" - - self:SetChecked(ww_vars.options.gems.usedTypes["Unique-Equipped"]) - - - - - + - - - - - @@ -198,33 +221,15 @@ end ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable) - - GameTooltip:SetOwner(self,"ANCHOR_RIGHT") - GameTooltip:AddLine("Consider gems that are Jewelcrafter-Only when finding ideal gems", 1, 1, 1) - GameTooltip:Show() - - - GameTooltip:Hide() - - getglobal(self:GetName() .. "Text"):SetText(self:GetText()) + self.shouldBeChecked = function() return ww_vars.options.gems.usedTypes["Jewelcrafter-Only"] end + self.ttText = "Consider gems that are Jewelcrafter-Only when finding ideal gems" - - self:SetChecked(ww_vars.options.gems.usedTypes["Jewelcrafter-Only"]) - - - - - + - - - - - @@ -235,33 +240,15 @@ end ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable) - - GameTooltip:SetOwner(self,"ANCHOR_RIGHT") - GameTooltip:AddLine("Consider gems that are created by a proc (i.e. Wrath \"Perfect\" gems) when finding ideal gems", 1, 1, 1) - GameTooltip:Show() - - - GameTooltip:Hide() - - getglobal(self:GetName() .. "Text"):SetText(self:GetText()) + self.shouldBeChecked = function() return ww_vars.options.gems.usedTypes["Procced"] end + self.ttText = "Consider gems that are created by a proc (i.e. Wrath \"Perfect\" gems) when finding ideal gems" - - self:SetChecked(ww_vars.options.gems.usedTypes["Procced"]) - - - - - + - - - - - @@ -274,26 +261,13 @@ end ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable) - - GameTooltip:SetOwner(self,"ANCHOR_RIGHT") - GameTooltip:AddLine("Chooses ideal gems that obey their socket color (even if that gives a lower overall score)", 1, 1, 1) - GameTooltip:Show() - - - GameTooltip:Hide() - - getglobal(self:GetName() .. "Text"):SetText(self:GetText()) + self.shouldBeChecked = function() return not ww_vars.options.breakSocketColors end + self.ttText = "Chooses ideal gems that obey their socket color (even if that gives a lower overall score)" - - self:SetChecked(not ww_vars.options.breakSocketColors) - - - - - + @@ -310,45 +284,16 @@ end ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable) - - self.text:SetTextColor(0.5, 0.5, 0.5) - - - self.text:SetTextColor(1, 0.82, 0) - - - GameTooltip:SetOwner(self,"ANCHOR_RIGHT") - GameTooltip:AddLine("Forces ideal gems to obey their socket color (even if the socket bonus has a 0 or negative score for that weight)", 1, 1, 1) - GameTooltip:Show() - - - GameTooltip:Hide() - - self.text = getglobal(self:GetName() .. "Text") - self.text:SetText(self:GetText()) + self.shouldBeChecked = function() return ww_vars.options.neverBreakSocketColors end + self.shouldBeEnabled = function() return not ww_vars.options.breakSocketColors end + self.ttText = "Forces ideal gems to obey their socket color (even if the socket bonus has a 0 or negative score for that weight)" - - self:SetChecked(ww_vars.options.neverBreakSocketColors) - if ww_vars.options.breakSocketColors then - self:Disable() - else - self:Enable() - end - - - - - + - - - - - @@ -360,20 +305,10 @@ ww_weightCache = setmetatable({}, ww_weightCacheMetatable) ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable) - - GameTooltip:SetOwner(self,"ANCHOR_RIGHT") - GameTooltip:AddLine("Divides item scores by the total of all stats' values in that weight", 1, 1, 1) - GameTooltip:Show() - - - GameTooltip:Hide() - - getglobal(self:GetName() .. "Text"):SetText(self:GetText()) + self.shouldBeChecked = function() return ww_vars.options.normalizeWeights end + self.ttText = "Divides item scores by the total of all stats' values in that weight" - - self:SetChecked(ww_vars.options.normalizeWeights) - @@ -448,17 +383,9 @@ - - - - + - - - - - @@ -468,20 +395,10 @@ ww_vars.options.tooltip.hideHints = false end - - GameTooltip:SetOwner(self,"ANCHOR_RIGHT") - GameTooltip:AddLine("Hides modifier key hints in tooltips", 1, 1, 1) - GameTooltip:Show() - - - GameTooltip:Hide() - - getglobal(self:GetName() .. "Text"):SetText(self:GetText()) + self.shouldBeChecked = function() return ww_vars.options.tooltip.hideHints end + self.ttText = "Hides modifier key hints in tooltips" - - self:SetChecked(ww_vars.options.tooltip.hideHints) - @@ -517,17 +434,9 @@ - - - - + - - - - - @@ -537,20 +446,10 @@ ww_vars.options.tooltip.showDifferences = false end - - GameTooltip:SetOwner(self,"ANCHOR_RIGHT") - GameTooltip:AddLine("Shows the change in score compared to the currently equipped gear", 1, 1, 1) - GameTooltip:Show() - - - GameTooltip:Hide() - - getglobal(self:GetName() .. "Text"):SetText(self:GetText()) + self.shouldBeChecked = function() return ww_vars.options.tooltip.showDifferences end + self.ttText = "Shows the change in score compared to the currently equipped gear" - - self:SetChecked(ww_vars.options.tooltip.showDifferences) - -- 1.7.9.5