comparison config.lua @ 51:6f1bb8fcf64d v18

AskMrRobot.toc - Added line for new SettingsTab file AskMrRobotUi.lua - Added code for new Settings menu amr-constants.lua - Added instance IDs for all WoD 6.0 5-mans and Raids. - Removed legacy SoO IDs. config.lua - Removed "Interface/Addons" options area, migrated all settings to main addon window. localization/localization.en.lua - Added new strings for new Settings tab and new Raid auto-logging ui/CombatLogTab.lua - Removed legacy SoO code - Added auto-logging settings for Highmaul and Blackrock Foundry. ui/SettingsTab.lua - new main window tab for Minimap and Auction House settings options
author TuhMuffinMan <TuhMuffinMan>
date Fri, 28 Nov 2014 13:09:52 -0600
parents e77e01abce98
children
comparison
equal deleted inserted replaced
50:af0dc99cbedb 51:6f1bb8fcf64d
3 3
4 local wow_ver = select(4, GetBuildInfo()) 4 local wow_ver = select(4, GetBuildInfo())
5 local wow_500 = wow_ver >= 50000 5 local wow_500 = wow_ver >= 50000
6 local UIPanelButtonTemplate = wow_500 and "UIPanelButtonTemplate" or "UIPanelButtonTemplate2" 6 local UIPanelButtonTemplate = wow_500 and "UIPanelButtonTemplate" or "UIPanelButtonTemplate2"
7 7
8 local frame = CreateFrame("Frame", nil, InterfaceOptionsFramePanelContainer)
9 frame.name = addonName
10 frame:Hide()
11
12 -- Credits to Ace3, Tekkub, cladhaire and Tuller for some of the widget stuff.
13
14 local function newCheckbox(label, tooltipTitle, description, onClick)
15 local check = CreateFrame("CheckButton", "AmrCheck" .. label, frame, "InterfaceOptionsCheckButtonTemplate")
16 check:SetScript("OnClick", function(self)
17 PlaySound(self:GetChecked() and "igMainMenuOptionCheckBoxOn" or "igMainMenuOptionCheckBoxOff")
18 onClick(self, self:GetChecked() and true or false)
19 end)
20 check.label = _G[check:GetName() .. "Text"]
21 check.label:SetText(label)
22 check.tooltipText = tooltipTitle
23 check.tooltipRequirement = description
24 return check
25 end
26
27 frame:SetScript("OnShow", function(frame)
28 local title = frame:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
29 title:SetPoint("TOPLEFT", 16, -16)
30 title:SetText(addonName)
31
32 local subTitleWrapper = CreateFrame("Frame", nil, frame)
33 subTitleWrapper:SetPoint("TOPLEFT", title, "BOTTOMLEFT", 0, -8)
34 subTitleWrapper:SetPoint("RIGHT", -16, 0)
35 local subtitle = subTitleWrapper:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
36 subtitle:SetPoint("TOPLEFT", subTitleWrapper)
37 subtitle:SetWidth(subTitleWrapper:GetRight() - subTitleWrapper:GetLeft())
38 subtitle:SetJustifyH("LEFT")
39 subtitle:SetNonSpaceWrap(false)
40 subtitle:SetJustifyV("TOP")
41 subtitle:SetText(L.AMR_CONFIG_EXIMPORT)
42 subTitleWrapper:SetHeight(subtitle:GetHeight())
43
44 -- hide minimap icon
45 local autoPopup = newCheckbox(
46 L.AMR_CONFIG_CHECKBOX_MINIMAP_LABEL,
47 L.AMR_CONFIG_CHECKBOX_MINIMAP_TOOLTIP_TITLE,
48 L.AMR_CONFIG_CHECKBOX_MINIMAP_DESCRIPTION,
49 function(self, value)
50 if AmrDb.Options.hideMapIcon then
51 AmrDb.Options.hideMapIcon = false
52 else
53 AmrDb.Options.hideMapIcon = true
54 end
55 AskMrRobot.AmrUpdateMinimap();
56 end
57 )
58 autoPopup:SetChecked(not AmrDb.Options.hideMapIcon)
59 autoPopup:SetPoint("TOPLEFT", subTitleWrapper, "BOTTOMLEFT", -2, -16)
60
61
62 -- auto-show at auction house
63 local autoAh = newCheckbox(
64 L.AMR_CONFIG_CHECKBOX_AUTOAH_LABEL,
65 L.AMR_CONFIG_CHECKBOX_AUTOAH_TOOLTIP_TITLE,
66 L.AMR_CONFIG_CHECKBOX_AUTOAH_DESCRIPTION,
67 function(self, value)
68 if AmrDb.Options.manualShowShop then
69 AmrDb.Options.manualShowShop = false
70 else
71 AmrDb.Options.manualShowShop = true
72 end
73 end
74 )
75 autoAh:SetChecked(not AmrDb.Options.manualShowShop)
76 autoAh:SetPoint("TOPLEFT", subTitleWrapper, "BOTTOMLEFT", -2, -58)
77
78 frame:SetScript("OnShow", nil)
79 end)
80 InterfaceOptions_AddCategory(frame)
81