comparison config.lua @ 0:ec731d2fe6ba

Version 1.2.12.0
author Adam tegen <adam.tegen@gmail.com>
date Tue, 20 May 2014 21:43:23 -0500
parents
children ece9167c0d1c
comparison
equal deleted inserted replaced
-1:000000000000 0:ec731d2fe6ba
1 local addonName, AskMrRobot = ...
2
3 --if not addon.healthCheck then return end
4 local L = AskMrRobot.L
5
6 local wow_ver = select(4, GetBuildInfo())
7 local wow_500 = wow_ver >= 50000
8 local UIPanelButtonTemplate = wow_500 and "UIPanelButtonTemplate" or "UIPanelButtonTemplate2"
9
10 local frame = CreateFrame("Frame", nil, InterfaceOptionsFramePanelContainer)
11 frame.name = addonName
12 frame:Hide()
13
14 -- Credits to Ace3, Tekkub, cladhaire and Tuller for some of the widget stuff.
15
16 local function newCheckbox(label, tooltipTitle, description, onClick)
17 local check = CreateFrame("CheckButton", "AmrCheck" .. label, frame, "InterfaceOptionsCheckButtonTemplate")
18 check:SetScript("OnClick", function(self)
19 PlaySound(self:GetChecked() and "igMainMenuOptionCheckBoxOn" or "igMainMenuOptionCheckBoxOff")
20 onClick(self, self:GetChecked() and true or false)
21 end)
22 check.label = _G[check:GetName() .. "Text"]
23 check.label:SetText(label)
24 check.tooltipText = tooltipTitle
25 check.tooltipRequirement = description
26 return check
27 end
28
29 frame:SetScript("OnShow", function(frame)
30 local title = frame:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
31 title:SetPoint("TOPLEFT", 16, -16)
32 title:SetText(addonName)
33
34 local subTitleWrapper = CreateFrame("Frame", nil, frame)
35 subTitleWrapper:SetPoint("TOPLEFT", title, "BOTTOMLEFT", 0, -8)
36 subTitleWrapper:SetPoint("RIGHT", -16, 0)
37 local subtitle = subTitleWrapper:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
38 subtitle:SetPoint("TOPLEFT", subTitleWrapper)
39 subtitle:SetWidth(subTitleWrapper:GetRight() - subTitleWrapper:GetLeft())
40 subtitle:SetJustifyH("LEFT")
41 subtitle:SetNonSpaceWrap(false)
42 subtitle:SetJustifyV("TOP")
43 subtitle:SetText("Mr. Robot's addon can export your item information to his website, and import your optimizations into the game.")
44 subTitleWrapper:SetHeight(subtitle:GetHeight())
45
46 local autoPopup = newCheckbox(
47 "Show minimap icon",
48 "Minimap Icon",
49 "Show the Ask Mr. Robot minimap icon.",
50 function(self, value)
51 if AmrOptions.hideMapIcon then
52 AmrOptions.hideMapIcon = false
53 else
54 AmrOptions.hideMapIcon = true
55 end
56 AskMrRobot.AmrUpdateMinimap();
57 end
58 )
59 autoPopup:SetChecked(not AmrOptions.hideMapIcon)
60 autoPopup:SetPoint("TOPLEFT", subTitleWrapper, "BOTTOMLEFT", -2, -16)
61
62 local autoReforge = newCheckbox(
63 "Automatically show Mr. Robot's reforge window at the reforger",
64 "Auto-Show Reforges",
65 "When you have suggested reforges left to complete, automatically show Mr. Robot's reforge window when you visit a reforger.",
66 function(self, value)
67 if AmrOptions.manualShowReforge then
68 AmrOptions.manualShowReforge = false
69 else
70 AmrOptions.manualShowReforge = true
71 end
72 end
73 )
74 autoReforge:SetChecked(not AmrOptions.manualShowReforge)
75 autoReforge:SetPoint("TOPLEFT", subTitleWrapper, "BOTTOMLEFT", -2, -52)
76
77 local autoAh = newCheckbox(
78 "Automatically show Mr. Robot's shopping list at the auction house",
79 "Auto-Show Shopping List",
80 "When your shopping list still has things left to buy, automatically show Mr. Robot's shopping list when you visit the auction house.",
81 function(self, value)
82 if AmrOptions.manualShowShop then
83 AmrOptions.manualShowShop = false
84 else
85 AmrOptions.manualShowShop = true
86 end
87 end
88 )
89 autoAh:SetChecked(not AmrOptions.manualShowShop)
90 autoAh:SetPoint("TOPLEFT", subTitleWrapper, "BOTTOMLEFT", -2, -88)
91
92 --[[
93 AmrOptions.autoLog = AmrOptions.autoLog or {}
94
95 local autoCombatLog = newCheckbox(
96 "Automatically turn on combat logging for Siege of Orgrimmar",
97 "Automatically Log Siege of Orgrimmar",
98 "When entering Siege of Orgrimmar, combat logging will be turned on. When leaving Siege of Orgrimmar, combat logging will be turned off.",
99 function(self, value)
100 if AmrOptions.autoLog[1136] then
101 AmrOptions.autoLog[1136] = false
102 else
103 AmrOptions.autoLog[1136] = true
104 end
105 end
106 )
107 autoCombatLog:SetChecked(AmrOptions.autoLog[1136])
108 autoCombatLog:SetPoint("TOPLEFT", subTitleWrapper, "BOTTOMLEFT", -2, -124)
109 ]]
110
111 frame:SetScript("OnShow", nil)
112 end)
113 InterfaceOptions_AddCategory(frame)
114