-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathOptions.lua
More file actions
200 lines (194 loc) · 9.61 KB
/
Options.lua
File metadata and controls
200 lines (194 loc) · 9.61 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
local BuffTimers = LibStub("AceAddon-3.0"):GetAddon("BuffTimers")
local module = BuffTimers:NewModule("Config")
local L = LibStub("AceLocale-3.0"):GetLocale("BuffTimers")
BuffTimersLibSharedMedia = LibStub("LibSharedMedia-3.0", true)
local db
function module:OnInitialize()
db = BuffTimers.db
local options = {
type = "group",
name = "BuffTimers",
args = {
time = {
type = "group",
name = L["Time"],
order = 10,
args = {
formatGroup = {
type = "group",
name = L["Format"],
inline = true,
args = {
timeFormat = {
type = "select",
name = L["Time Stamp Format"],
desc = L["Choose the format for displaying buff duration"],
values = {
["m"] = "minutes (119m)",
["hm"] = "h:mm (1:59h)",
},
get = function() return db.profile.time_stamp end,
set = function(_, value) db.profile.time_stamp = value end,
order = 1,
},
},
},
secondsThresholdGroup = {
type = "group",
name = L["Seconds"],
inline = true,
args = {
showSeconds = {
type = "toggle",
name = L["Show seconds"],
desc = L["Show seconds for buff timers"],
get = function() return db.profile.seconds end,
set = function(_, value) db.profile.seconds = value end,
order = 2,
},
secondsThreshold = {
type = "range",
name = L["Show seconds below this time"],
desc = L["Only show seconds when buffs have less than this many minutes"],
width = "full",
min = 1,
max = 120,
step = 1,
get = function() return db.profile.seconds_threshold end,
set = function(_, value) db.profile.seconds_threshold = value end,
order = 3,
},
showMilliseconds = {
type = "toggle",
name = L["Show milliseconds below 5 seconds"],
desc = L["Show milliseconds for buff timers with less than 5 seconds remaining"],
width = "full",
get = function() return db.profile.milliseconds end,
set = function(_, value) db.profile.milliseconds = value end,
order = 4,
},
}
}
}
},
textGroup = {
type = "group",
name = L["Text"],
order = 15,
args = {
colorGroup = {
type = "group",
name = L["Color"],
inline = true,
args = {
yellowText = {
type = "toggle",
name = L["Always yellow text color"],
desc = L["Always use yellow for buff timer text"],
get = function() return db.profile.yellow_text end,
set = function(_, value) db.profile.yellow_text = value end,
width = "full",
order = 1,
},
coloredText = {
type = "toggle",
name = L["Add more colors to the timer"],
desc = L["Use different colors based on remaining time"],
get = function() return db.profile.colored_text end,
set = function(_, value) db.profile.colored_text = value end,
width = "full",
order = 2,
},
}
},
customizeTextGroup = {
type = "group",
name = L["Customization"],
inline = true,
args = {
enableCustomizeText = {
type = "toggle",
name = L["Enable"],
desc = L["Enable text customization"],
get = function() return db.profile.customize_text end,
set = function(_, value) db.profile.customize_text = value end,
width = "full",
order = 7,
},
verticalPosition = {
type = "range",
name = L["Text vertical position"],
desc = L["Adjust the vertical position of the timer text"],
min = -100,
max = 100,
step = 1,
get = function() return db.profile.vertical_position end,
set = function(_, value) db.profile.vertical_position = value end,
order = 8,
},
fontGroup = {
type = "group",
name = L["Font"],
inline = true,
args = {
font = {
type = "select",
name = L["Font"],
desc = L["Choose the font for the timer text"],
values = function()
local fonts = BuffTimersLibSharedMedia:List("font")
local values = {}
for _, font in ipairs(fonts) do
values[font] = font
end
return values
end,
get = function() return db.profile.font end,
set = function(_, value) db.profile.font = value end,
order = 1,
},
fontSize = {
type = "range",
name = L["Font Size"],
desc = L["Adjust the font size of the timer text"],
min = 1,
max = 100,
step = 1,
get = function() return db.profile.font_size end,
set = function(_, value) db.profile.font_size = value end,
order = 2,
},
fontOutline = {
type = "select",
name = L["Outline"],
desc = L["Choose the outline for the timer text"],
values = {
[""] = "None",
["OUTLINE"] = "Outline",
["THICK"] = "Thick",
["MONOCHROME"] = "Monochrome",
},
get = function() return db.profile.font_outline end,
set = function(_, value) db.profile.font_outline = value end,
order = 3,
}
}
}
}
}
},
},
},
}
-- Register the options with AceConfig
LibStub("AceConfigRegistry-3.0"):RegisterOptionsTable("BuffTimers", options)
-- Create the options panel
LibStub("AceConfigDialog-3.0"):AddToBlizOptions("BuffTimers", "BuffTimers")
end
function module:ShowConfig()
LibStub("AceConfigDialog-3.0"):Open("BuffTimers")
end
SLASH_BUFFTIMERS1 = "/bufftimers"
function SlashCmdList.BUFFTIMERS()
module:ShowConfig()
end