-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathaddonsTab.lua
More file actions
50 lines (41 loc) · 2.1 KB
/
Copy pathaddonsTab.lua
File metadata and controls
50 lines (41 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
local T = Angleur_Translate
-- Going with vertical-layout-category for now, might implement a canvas category later instead
-- (Canvas provides more control)
function Angleur_LoadAddonsTab()
local category, layout = Settings.RegisterVerticalLayoutCategory("Angleur")
do
local name = "Show Minimap Button"
local variable = "Angleur_ShowMinimap"
local variableKey = "show"
local variableTbl = AngleurMinimapButton
local defaultValue = false
local function OnSettingChanged(setting, value)
-- print("Setting changed:", setting:GetVariable(), value)
Angleur_ToggleMinimapButton(value)
end
local setting = Settings.RegisterAddOnSetting(category, variable, variableKey, variableTbl, type(defaultValue), name, defaultValue)
setting:SetValueChangedCallback(OnSettingChanged)
local tooltip = "This is a tooltip for the checkbox."
local cbox1 = Settings.CreateCheckbox(category, setting, tooltip)
end
do
local buttonText, addSearchTags = T["Open Config Panel"], true
local tooltip = T["You need to open the Config Panel to change Angleur's settings!"
.. "\n\n(Hint) You can also:\n - type /ang\n - Double-Click the Angleur Visual\n - Click the Minimap/AddonCompartment Button\nto open it."]
local function onButtonClick(self)
local left, bottom = self:GetRect()
Angleur.configPanel:ClearAllPoints()
Angleur.configPanel:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", left, bottom - 30)
Angleur.configPanel:Raise()
if not Angleur.configPanel:IsShown() then Angleur.configPanel:Show() end
end
layout:AddInitializer(CreateSettingsButtonInitializer("", buttonText, onButtonClick, tooltip, addSearchTags))
end
Settings.RegisterAddOnCategory(category)
end
-- print("Settings: ")
-- DevTools_Dump(category:GetID())
-- DevTools_Dump(Settings.GetCategory(category:GetID()))
-- DevTools_Dump(category:GetCategorySet())
-- DevTools_Dump(category:GetName())
-- DevTools_Dump(Settings.GetSetting("Angleur_ShowMinimap"))