Added the "Skill Level" checkbox, beneath the "Display Exclusions" checkbox.
James D. Callahan III [04-21-10 - 04:00]
Added the "Skill Level" checkbox, beneath the "Display Exclusions" checkbox.
diff --git a/Frame.lua b/Frame.lua
index fcfb009..b28c9c7 100644
--- a/Frame.lua
+++ b/Frame.lua
@@ -1643,7 +1643,7 @@ end -- do
-- "Display Exclusions" checkbox.
-------------------------------------------------------------------------------
local ExcludeToggle = CreateFrame("CheckButton", nil, MainPanel, "UICheckButtonTemplate")
-ExcludeToggle:SetPoint("TOPLEFT", SearchBox, "BOTTOMLEFT", -5, -5)
+ExcludeToggle:SetPoint("TOPLEFT", SearchBox, "BOTTOMLEFT", -5, -10)
ExcludeToggle:SetHeight(16)
ExcludeToggle:SetWidth(16)
@@ -1671,6 +1671,38 @@ ExcludeToggle.text:SetText(L["Display Exclusions"])
SetTooltipScripts(ExcludeToggle, L["DISPLAY_EXCLUSION_DESC"], 1)
-------------------------------------------------------------------------------
+-- "Skill Level" checkbox.
+-------------------------------------------------------------------------------
+local SkillToggle = CreateFrame("CheckButton", nil, MainPanel, "UICheckButtonTemplate")
+SkillToggle:SetPoint("TOPLEFT", ExcludeToggle, "BOTTOMLEFT", 0, 0)
+SkillToggle:SetHeight(16)
+SkillToggle:SetWidth(16)
+
+
+SkillToggle.text = SkillToggle:CreateFontString(nil, "ARTWORK", "GameFontNormalSmall")
+SkillToggle.text:SetPoint("LEFT", SkillToggle, "RIGHT", 0, 0)
+
+SkillToggle:SetScript("OnClick",
+ function(self, button, down)
+ addon.db.profile.skill_view = not addon.db.profile.skill_view
+ ListFrame:Update(nil, false)
+ end)
+
+SkillToggle:SetScript("OnShow",
+ function(self)
+ self:SetChecked(addon.db.profile.skill_view)
+ end)
+
+SkillToggle:SetNormalTexture("Interface\\Buttons\\UI-CheckBox-Up")
+SkillToggle:SetPushedTexture("Interface\\Buttons\\UI-CheckBox-Down")
+SkillToggle:SetHighlightTexture("Interface\\Buttons\\UI-CheckBox-Highlight")
+SkillToggle:SetDisabledCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check-Disabled")
+SkillToggle:SetCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check")
+
+SkillToggle.text:SetText(_G.SKILL_LEVEL)
+SetTooltipScripts(SkillToggle, L["SKILL_TOGGLE_DESC"], 1)
+
+-------------------------------------------------------------------------------
-- Create the X-close button, and set its scripts.
-------------------------------------------------------------------------------
MainPanel.xclose_button = CreateFrame("Button", nil, MainPanel, "UIPanelCloseButton")
diff --git a/Locales/devel-enUS.lua b/Locales/devel-enUS.lua
index c1ec2dc..dcf037a 100644
--- a/Locales/devel-enUS.lua
+++ b/Locales/devel-enUS.lua
@@ -182,6 +182,7 @@ L["MAP_TRAINER_DESC"] = "Display trainers on the map."
L["MAP_VENDOR_DESC"] = "Display vendors on the map."
L["MAP_MONSTER_DESC"] = "Display monsters on the map."
L["MAP_QUEST_DESC"] = "Display quests on the map."
+L["SKILL_TOGGLE_DESC"] = "Displays recipes according to their skill level rather than by name."
-- Filter Config Options
L["Filtering Options"] = true