-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOptions.lua
44 lines (38 loc) · 1.43 KB
/
Options.lua
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
local _, CGM = ...
-- Sets the modifier to the given value.
function CGM:SetModifier(value)
CGMOptions.settings.modifier = value
CGM:Debug("auto accept modifier is " .. CGM.Modifiers[value])
end
-- Sets the number of steps to the given value.
function CGM:SetNbrSteps(slider, value)
slider.fontString:SetText("Number of steps - " .. value)
CGMOptions.settings.nbrSteps = value
CGM:Debug("set nbrSteps to " .. value)
CGM:UpdateSlider()
CGM:ResizeStepFrames()
CGM:UpdateStepFrames()
end
-- Toggles auto accept/hand in on or off.
function CGM:ToggleAuto()
CGMOptions.settings.autoAccept = not CGMOptions.settings.autoAccept
CGM:Debug("auto accept is " .. (CGMOptions.settings.autoAccept and "ON" or "OFF"))
end
-- Toggles debug mode on or off.
function CGM:ToggleDebug()
CGMOptions.settings.debug = not CGMOptions.settings.debug
if CGMOptions.settings.debug then
CGM:Debug("debug mode is ON")
CGM.debugQuestFrameIDLbl:Show()
else
CGM:Message("debug mod is OFF.")
CGM.debugQuestFrameIDLbl:Hide()
end
end
-- Loads all settings.
function CGM:LoadSettings()
CGMOptions.settings = CGMOptions.settings or {}
CGMOptions.settings.nbrSteps = CGMOptions.settings.nbrSteps or 4
CGMOptions.settings.debug = CGMOptions.settings.debug or false
CGMOptions.settings.modifier = CGMOptions.settings.modifier or CGM.Modifiers.SHIFT
end