-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettings.lua
More file actions
44 lines (37 loc) · 1.94 KB
/
Copy pathSettings.lua
File metadata and controls
44 lines (37 loc) · 1.94 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
function OnSettingChanged(setting, value)
-- print("Setting changed:", setting:GetVariable(), value)
local variableName = setting:GetVariable()
if not AAASettings[variableName] then
AAASettings[variableName] = {}
end
AAASettings[variableName] = value
-- print("Saved setting:", variableName, AAASettings[variableName])
end
function loadSettings()
local name = "Only Track my Keys"
local variable = "OnlyTrackMine"
local tooltip = "Whether or not the addon should track only runs where it is your key, or if it should track all mythic runs you participate in."
local savedValue = AAASettings[variable] or false
addCheckboxSetting( name, variable, tooltip, savedValue )
local name = "Only Track Timed Keys"
local variable = "OnlyTrackTimed"
local tooltip = "Whether or not the addon should track only runs where the key is completed in time."
local savedValue = AAASettings[variable] or false
addCheckboxSetting( name, variable, tooltip, savedValue )
local name = "Track Incomplete Keys"
local variable = "TrackIncomplete"
local tooltip = "Whether or not the addon should also track keys that deplete without finishing."
local savedValue = AAASettings[variable] or true
addCheckboxSetting( name, variable, tooltip, savedValue )
local name = "Hide Death Messages"
local variable = "HideDeathMessage"
local tooltip = "Whether or not the addon should print a death message when a player dies."
local savedValue = AAASettings[variable] or true
addCheckboxSetting( name, variable, tooltip, savedValue )
end
function addCheckboxSetting( text, variableName, tooltip, savedValue )
local variableKey = "toggle"
local setting = Settings.RegisterAddOnSetting(category, variableName, variableName .. variableKey, AAASettings, type(savedValue), text, savedValue)
setting:SetValueChangedCallback(OnSettingChanged)
Settings.CreateCheckbox(category, setting, tooltip)
end