vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | assert(BigWigs, "BigWigs not found!") |
2 | |||
3 | ------------------------------ |
||
4 | -- Are you local? -- |
||
5 | ------------------------------ |
||
6 | |||
7 | local L = AceLibrary("AceLocale-2.2"):new("BigWigsColors") |
||
8 | local PaintChips = AceLibrary("PaintChips-2.0") |
||
9 | |||
10 | ---------------------------- |
||
11 | -- Localization -- |
||
12 | ---------------------------- |
||
13 | |||
14 | L:RegisterTranslations("enUS", function() return { |
||
15 | ["Colors"] = true, |
||
16 | |||
17 | ["Messages"] = true, |
||
18 | ["Bars"] = true, |
||
19 | ["Shortbar"] = true, |
||
20 | ["Longbar"] = true, |
||
21 | ["Color %s"] = true, |
||
22 | ["Color%s"] = true, |
||
23 | ["Number of colors"] = true, |
||
24 | ["xColors"] = true, |
||
25 | ["Background"] = true, |
||
26 | ["Text"] = true, |
||
27 | ["Reset"] = true, |
||
28 | |||
29 | ["Colors of messages and bars."] = true, |
||
30 | ["Colors of messages."] = true, |
||
31 | ["Change the color for \"%s\" messages."] = true, |
||
32 | ["Colors of bars."] = true, |
||
33 | ["Colors for short bars (< 1 minute)."] = true, |
||
34 | ["Colors for long bars (> 1 minute)."] = true, |
||
35 | ["Change the %s color."] = true, |
||
36 | ["Number of colors the bar has."] = true, |
||
37 | ["Change the background color."] = true, |
||
38 | ["Change the text color."] = true, |
||
39 | ["Resets all ranges to defaults."] = true, |
||
40 | |||
41 | ["Important"] = true, |
||
42 | ["Personal"] = true, |
||
43 | ["Urgent"] = true, |
||
44 | ["Attention"] = true, |
||
45 | ["Positive"] = true, |
||
46 | ["Bosskill"] = true, |
||
47 | ["Core"] = true, |
||
48 | |||
49 | ["1st"] = true, |
||
50 | ["2nd"] = true, |
||
51 | ["3rd"] = true, |
||
52 | ["4th"] = true, |
||
53 | } end) |
||
54 | |||
55 | L:RegisterTranslations("koKR", function() return { |
||
56 | ["Colors"] = "색상", |
||
57 | |||
58 | ["Messages"] = "메세지", |
||
59 | ["Bars"] = "바", |
||
60 | ["Shortbar"] = "짧은바", |
||
61 | ["Longbar"] = "긴바", |
||
62 | ["Color %s"] = "색상 %s", |
||
63 | ["Color%s"] = "색상%s", |
||
64 | ["Number of colors"] = "색상의 수", |
||
65 | ["xColors"] = "x색상", |
||
66 | ["Background"] = "배경", |
||
67 | ["Text"] = "글자", |
||
68 | ["Reset"] = "초기화", |
||
69 | |||
70 | ["Colors of messages and bars."] = "메세지와 바의 색상.", |
||
71 | ["Colors of messages."] = "메세지의 색생", |
||
72 | ["Change the color for \"%s\" messages."] = "\"%s\" 메세지에 대한 색생 변경.", |
||
73 | ["Colors of bars."] = "바의 색상.", |
||
74 | ["Colors for short bars (< 1 minute)."] = "짧은 바에 대한 색상 (< 1 분).", |
||
75 | ["Colors for long bars (> 1 minute)."] = "긴 바에 대한 색상 (> 1 분).", |
||
76 | ["Change the %s color."] = "%s 색상 변경.", |
||
77 | ["Number of colors the bar has."] = "Number of colors the bar has.", |
||
78 | ["Change the background color."] = "배경 색상 변경.", |
||
79 | ["Change the text color."] = "글자 색상 변경.", |
||
80 | ["Resets all ranges to defaults."] = "기본 설정으로 초기화.", |
||
81 | |||
82 | ["Important"] = "중요", |
||
83 | ["Personal"] = "개인", |
||
84 | ["Urgent"] = "긴급", |
||
85 | ["Attention"] = "주의", |
||
86 | ["Positive"] = "제안", |
||
87 | ["Bosskill"] = "보스사망", |
||
88 | ["Core"] = "코어", |
||
89 | |||
90 | ["1st"] = "첫째", |
||
91 | ["2nd"] = "둘째", |
||
92 | ["3rd"] = "셋째", |
||
93 | ["4th"] = "넷째", |
||
94 | } end) |
||
95 | |||
96 | L:RegisterTranslations("zhCN", function() return { |
||
97 | ["Colors"] = "颜色", |
||
98 | |||
99 | ["Messages"] = "信息", |
||
100 | ["Bars"] = "计时条", |
||
101 | ["Shortbar"] = "短计时条", |
||
102 | ["Longbar"] = "长计时条", |
||
103 | ["Color %s"] = "颜色 %s", |
||
104 | ["Color%s"] = "颜色%s", |
||
105 | ["Number of colors"] = "颜色数量", |
||
106 | ["xColors"] = "x颜色", |
||
107 | ["Background"] = "背景", |
||
108 | ["Text"] = "文本", |
||
109 | ["Reset"] = "重置", |
||
110 | |||
111 | ["Colors of messages and bars."] = "信息文字与计时条颜色。", |
||
112 | ["Colors of messages."] = "信息文字颜色。", |
||
113 | ["Change the color for \"%s\" messages."] = "变更\"%s\"信息的颜色。", |
||
114 | ["Colors of bars."] = "计时条颜色。", |
||
115 | ["Colors for short bars (< 1 minute)."] = "短时计时条(小于一分钟)的颜色。", |
||
116 | ["Colors for long bars (> 1 minute)."] = "长时计时条(大于一分钟)的颜色。", |
||
117 | ["Change the %s color."] = "变更颜色%s。", |
||
118 | ["Number of colors the bar has."] = "计时条颜色数量。", |
||
119 | ["Change the background color."] = "变更背景颜色。", |
||
120 | ["Change the text color."] = "变更文本颜色。", |
||
121 | ["Resets all ranges to defaults."] = "全部重置为默认状态。", |
||
122 | |||
123 | ["Important"] = "重要", |
||
124 | ["Personal"] = "个人", |
||
125 | ["Urgent"] = "紧急", |
||
126 | ["Attention"] = "注意", |
||
127 | ["Positive"] = "积极", |
||
128 | ["Bosskill"] = "首领击杀", |
||
129 | ["Core"] = "核心", |
||
130 | |||
131 | ["1st"] = "第一", |
||
132 | ["2nd"] = "第二", |
||
133 | ["3rd"] = "第三", |
||
134 | ["4th"] = "第四", |
||
135 | } end) |
||
136 | |||
137 | L:RegisterTranslations("zhTW", function() return { |
||
138 | ["Colors"] = "顏色", |
||
139 | |||
140 | ["Messages"] = "訊息", |
||
141 | ["Bars"] = "計時條", |
||
142 | ["Shortbar"] = "短計時條", |
||
143 | ["Longbar"] = "長計時條", |
||
144 | ["Color %s"] = "顏色 %s", |
||
145 | ["Color%s"] = "顏色%s", |
||
146 | ["Number of colors"] = "顏色數量", |
||
147 | ["xColors"] = "x顏色", |
||
148 | ["Background"] = "背景", |
||
149 | ["Text"] = "文字", |
||
150 | ["Reset"] = "重置", |
||
151 | |||
152 | ["Colors of messages and bars."] = "訊息文字與計時條顏色。", |
||
153 | ["Colors of messages."] = "訊息文字顏色。", |
||
154 | ["Change the color for \"%s\" messages."] = "變更\"%s\"訊息的顏色。", |
||
155 | ["Colors of bars."] = "計時條顏色。", |
||
156 | ["Colors for short bars (< 1 minute)."] = "短時計時條(小於一分鐘)的顏色。", |
||
157 | ["Colors for long bars (> 1 minute)."] = "長時計時條(大於一分鐘)的顏色。", |
||
158 | ["Change the %s color."] = "變更顏色%s。", |
||
159 | ["Number of colors the bar has."] = "計時條顏色數量。", |
||
160 | ["Change the background color."] = "變更背景顏色。", |
||
161 | ["Change the text color."] = "變更文字顏色。", |
||
162 | ["Resets all ranges to defaults."] = "全部重置為預設狀態。", |
||
163 | |||
164 | ["Important"] = "重要", |
||
165 | ["Personal"] = "個人", |
||
166 | ["Urgent"] = "緊急", |
||
167 | ["Attention"] = "注意", |
||
168 | ["Positive"] = "積極", |
||
169 | ["Bosskill"] = "首領擊殺", |
||
170 | ["Core"] = "核心", |
||
171 | |||
172 | ["1st"] = "第一", |
||
173 | ["2nd"] = "第二", |
||
174 | ["3rd"] = "第三", |
||
175 | ["4th"] = "第四", |
||
176 | } end) |
||
177 | |||
178 | L:RegisterTranslations("deDE", function() return { |
||
179 | ["Colors"] = "Farben", |
||
180 | |||
181 | ["Messages"] = "Nachrichten", |
||
182 | ["Bars"] = "Anzeigebalken", |
||
183 | ["Shortbar"] = "KurzerAnzeigebalken", |
||
184 | ["Longbar"] = "LangerAnzeigebalken", |
||
185 | ["Color %s"] = "Farbe %s", |
||
186 | ["Color%s"] = "Farbe%s", |
||
187 | ["Number of colors"] = "Anzahl der Farben", |
||
188 | ["xColors"] = "xFarben", |
||
189 | ["Background"] = "Hintergrund", |
||
190 | ["Text"] = "Text", |
||
191 | ["Reset"] = "Zur\195\188cksetzen", |
||
192 | |||
193 | ["Colors of messages and bars."] = "Farben der Nachrichten und Anzeigebalken.", |
||
194 | ["Colors of messages."] = "Farben der Nachrichten.", |
||
195 | ["Change the color for \"%s\" messages."] = "Farbe \195\164ndern f\195\188r \"%s\" Nachrichten.", |
||
196 | ["Colors of bars."] = "Farben der Anzeigebalken.", |
||
197 | ["Colors for short bars (< 1 minute)."] = "Farben f\195\188r kurze Anzeigebalken (< 1 Minute).", |
||
198 | ["Colors for long bars (> 1 minute)."] = "Farben f\195\188r lange Anzeigebalken (> 1 Minute).", |
||
199 | ["Change the %s color."] = "Die %s Farbe \195\164ndern.", |
||
200 | ["Number of colors the bar has."] = "Anzahl der Farben eines Anzeigebalkens.", |
||
201 | ["Change the background color."] = "Hintergrund Farbe \195\164ndern.", |
||
202 | ["Change the text color."] = "Textfarbe \195\164ndern.", |
||
203 | ["Resets all ranges to defaults."] = "Auf Standard zur\195\188cksetzen.", |
||
204 | |||
205 | ["Important"] = "Wichtig", |
||
206 | ["Personal"] = "Pers\195\182hnlich", |
||
207 | ["Urgent"] = "Dringend", |
||
208 | ["Attention"] = "Achtung", |
||
209 | ["Positive"] = "Positiv", |
||
210 | ["Bosskill"] = "Bosskill", |
||
211 | ["Core"] = "Core", |
||
212 | |||
213 | ["1st"] = "1te", |
||
214 | ["2nd"] = "2te", |
||
215 | ["3rd"] = "3te", |
||
216 | ["4th"] = "4te", |
||
217 | } end) |
||
218 | |||
219 | L:RegisterTranslations("frFR", function() return { |
||
220 | ["Colors"] = "Couleurs", |
||
221 | |||
222 | ["Messages"] = "Messages", |
||
223 | ["Bars"] = "Barres", |
||
224 | ["Shortbar"] = "BarresCourtes", |
||
225 | ["Longbar"] = "BarresLongues", |
||
226 | ["Color %s"] = "Couleur %s", |
||
227 | ["Color%s"] = "Couleur%s", |
||
228 | ["Number of colors"] = "Nombre de couleurs", |
||
229 | ["xColors"] = "nCouleurs", |
||
230 | ["Background"] = "Fond", |
||
231 | ["Text"] = "Texte", |
||
232 | ["Reset"] = "RÀZ", |
||
233 | |||
234 | ["Colors of messages and bars."] = "Couleurs des messages et des barres.", |
||
235 | ["Colors of messages."] = "Couleurs des messages.", |
||
236 | ["Change the color for \"%s\" messages."] = "Change la couleur des messages \"%s\".", |
||
237 | ["Colors of bars."] = "Couleurs des barres.", |
||
238 | ["Colors for short bars (< 1 minute)."] = "Couleurs des barres de courte durée (< 1 minute).", |
||
239 | ["Colors for long bars (> 1 minute)."] = "Couleurs des barres de longue durée (> 1 minute).", |
||
240 | ["Change the %s color."] = "Change la couleur de %s.", |
||
241 | ["Number of colors the bar has."] = "Nombre de couleurs que possède la barre.", |
||
242 | ["Change the background color."] = "Change la couleur du fond.", |
||
243 | ["Change the text color."] = "Change la couleur du texte.", |
||
244 | ["Resets all ranges to defaults."] = "Réinitialise tous les paramètres à leurs valeurs par défaut.", |
||
245 | |||
246 | ["Important"] = "Important", |
||
247 | ["Personal"] = "Personnel", |
||
248 | ["Urgent"] = "Urgent", |
||
249 | ["Attention"] = "Attention", |
||
250 | ["Positive"] = "Positif", |
||
251 | ["Bosskill"] = "Défaite", |
||
252 | ["Core"] = "Noyau", |
||
253 | |||
254 | ["1st"] = "1er", |
||
255 | ["2nd"] = "2ème", |
||
256 | ["3rd"] = "3ème", |
||
257 | ["4th"] = "4ème", |
||
258 | } end) |
||
259 | |||
260 | ---------------------------------- |
||
261 | -- Module Declaration -- |
||
262 | ---------------------------------- |
||
263 | |||
264 | BigWigsColors = BigWigs:NewModule(L["Colors"]) |
||
265 | BigWigsColors.defaultDB = { |
||
266 | important = "ff0000", -- Red |
||
267 | personal = "ff0000", -- Red |
||
268 | urgent = "ff7f00", -- Orange |
||
269 | attention = "ffff00", -- Yellow |
||
270 | positive = "00ff00", -- Green |
||
271 | bosskill = "00ff00", -- Green |
||
272 | core = "00ffff", -- Cyan |
||
273 | |||
274 | shortbar = {"ffff00", "ff7f00", "ff0000"}, |
||
275 | shortnr = 3, |
||
276 | longbar = {"00ff00", "ffff00", "ff7f00", "ff0000"}, |
||
277 | longnr = 4, |
||
278 | } |
||
279 | BigWigsColors.consoleCmd = L["Colors"] |
||
280 | BigWigsColors.consoleOptions = { |
||
281 | type = "group", |
||
282 | name = L["Colors"], |
||
283 | desc = L["Colors of messages and bars."], |
||
284 | args = { |
||
285 | [L["Messages"]] = { |
||
286 | type = "group", |
||
287 | name = L["Messages"], |
||
288 | desc = L["Colors of messages."], |
||
289 | order = 1, |
||
290 | args = { |
||
291 | [L["Important"]] = { |
||
292 | name = L["Important"], |
||
293 | type = "color", |
||
294 | desc = string.format(L["Change the color for \"%s\" messages."], L["Important"]), |
||
295 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.important); return r, g, b end, |
||
296 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.important = hex end, |
||
297 | order = 1, |
||
298 | }, |
||
299 | [L["Personal"]] = { |
||
300 | name = L["Personal"], |
||
301 | type = "color", |
||
302 | desc = string.format(L["Change the color for \"%s\" messages."], L["Personal"]), |
||
303 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.personal); return r, g, b end, |
||
304 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.personal = hex end, |
||
305 | order = 2, |
||
306 | }, |
||
307 | [L["Urgent"]] = { |
||
308 | name = L["Urgent"], |
||
309 | type = "color", |
||
310 | desc = string.format(L["Change the color for \"%s\" messages."], L["Urgent"]), |
||
311 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.urgent); return r, g, b end, |
||
312 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.urgent = hex end, |
||
313 | order = 3, |
||
314 | }, |
||
315 | [L["Attention"]] = { |
||
316 | name = L["Attention"], |
||
317 | type = "color", |
||
318 | desc = string.format(L["Change the color for \"%s\" messages."], L["Attention"]), |
||
319 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.attention); return r, g, b end, |
||
320 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.attention = hex end, |
||
321 | order = 4, |
||
322 | }, |
||
323 | [L["Positive"]] = { |
||
324 | name = L["Positive"], |
||
325 | type = "color", |
||
326 | desc = string.format(L["Change the color for \"%s\" messages."], L["Positive"]), |
||
327 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.positive); return r, g, b end, |
||
328 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.positive = hex end, |
||
329 | order = 5, |
||
330 | }, |
||
331 | [L["Bosskill"]] = { |
||
332 | name = L["Bosskill"], |
||
333 | type = "color", |
||
334 | desc = string.format(L["Change the color for \"%s\" messages."], L["Bosskill"]), |
||
335 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.bosskill); return r, g, b end, |
||
336 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.bosskill = hex end, |
||
337 | order = 6, |
||
338 | }, |
||
339 | [L["Core"]] = { |
||
340 | name = L["Core"], |
||
341 | type = "color", |
||
342 | desc = string.format(L["Change the color for \"%s\" messages."], L["Core"]), |
||
343 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.core); return r, g, b end, |
||
344 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.core = hex end, |
||
345 | order = 7, |
||
346 | }, |
||
347 | }, |
||
348 | }, |
||
349 | [L["Bars"]] = { |
||
350 | type = "group", |
||
351 | name = L["Bars"], |
||
352 | desc = L["Colors of bars."], |
||
353 | order = 2, |
||
354 | args = { |
||
355 | [L["Shortbar"]] = { |
||
356 | type = "group", |
||
357 | name = L["Shortbar"], |
||
358 | desc = L["Colors for short bars (< 1 minute)."], |
||
359 | order = 1, |
||
360 | args = { |
||
361 | [string.format(L["Color%s"], 1)] = { |
||
362 | name = string.format(L["Color %s"], 1), |
||
363 | type = "color", |
||
364 | desc = string.format(L["Change the %s color."], L["1st"]), |
||
365 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.shortbar[1]); return r, g, b end, |
||
366 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.shortbar[1] = hex end, |
||
367 | order = 1, |
||
368 | }, |
||
369 | [string.format(L["Color%s"], 2)] = { |
||
370 | name = string.format(L["Color %s"], 2), |
||
371 | type = "color", |
||
372 | desc = string.format(L["Change the %s color."], L["2nd"]), |
||
373 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.shortbar[2]); return r, g, b end, |
||
374 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.shortbar[2] = hex end, |
||
375 | hidden = function() if BigWigsColors.db.profile.shortnr < 2 then return true end end, |
||
376 | order = 2, |
||
377 | }, |
||
378 | [string.format(L["Color%s"], 3)] = { |
||
379 | name = string.format(L["Color %s"], 3), |
||
380 | type = "color", |
||
381 | desc = string.format(L["Change the %s color."], L["3rd"]), |
||
382 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.shortbar[3]); return r, g, b end, |
||
383 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.shortbar[3] = hex end, |
||
384 | hidden = function() if BigWigsColors.db.profile.shortnr < 3 then return true end end, |
||
385 | order = 3, |
||
386 | }, |
||
387 | [string.format(L["Color%s"], 4)] = { |
||
388 | name = string.format(L["Color %s"], 4), |
||
389 | type = "color", |
||
390 | desc = string.format(L["Change the %s color."], L["4th"]), |
||
391 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.shortbar[4]); return r, g, b end, |
||
392 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.shortbar[4] = hex end, |
||
393 | hidden = function() if BigWigsColors.db.profile.shortnr < 4 then return true end end, |
||
394 | order = 4, |
||
395 | }, |
||
396 | [L["xColors"]] = { |
||
397 | name = L["Number of colors"], |
||
398 | type = "range", |
||
399 | desc = L["Number of colors the bar has."], |
||
400 | min = 1, |
||
401 | max = 4, |
||
402 | step = 1, |
||
403 | get = function() return BigWigsColors.db.profile.shortnr end, |
||
404 | set = function(v) BigWigsColors.db.profile.shortnr = v end, |
||
405 | order = 5, |
||
406 | }, |
||
407 | }, |
||
408 | }, |
||
409 | [L["Longbar"]] = { |
||
410 | type = "group", |
||
411 | name = L["Longbar"], |
||
412 | desc = L["Colors for long bars (> 1 minute)."], |
||
413 | order = 2, |
||
414 | args = { |
||
415 | [string.format(L["Color%s"], 1)] = { |
||
416 | name = string.format(L["Color %s"], 1), |
||
417 | type = "color", |
||
418 | desc = string.format(L["Change the %s color."], L["1st"]), |
||
419 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.longbar[1]); return r, g, b end, |
||
420 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.longbar[1] = hex end, |
||
421 | order = 1, |
||
422 | }, |
||
423 | [string.format(L["Color%s"], 2)] = { |
||
424 | name = string.format(L["Color %s"], 2), |
||
425 | type = "color", |
||
426 | desc = string.format(L["Change the %s color."], L["2nd"]), |
||
427 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.longbar[2]); return r, g, b end, |
||
428 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.longbar[2] = hex end, |
||
429 | hidden = function() if BigWigsColors.db.profile.longnr < 2 then return true end end, |
||
430 | order = 2, |
||
431 | }, |
||
432 | [string.format(L["Color%s"], 3)] = { |
||
433 | name = string.format(L["Color %s"], 3), |
||
434 | type = "color", |
||
435 | desc = string.format(L["Change the %s color."], L["3rd"]), |
||
436 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.longbar[3]); return r, g, b end, |
||
437 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.longbar[3] = hex end, |
||
438 | hidden = function() if BigWigsColors.db.profile.longnr < 3 then return true end end, |
||
439 | order = 3, |
||
440 | }, |
||
441 | [string.format(L["Color%s"], 4)] = { |
||
442 | name = string.format(L["Color %s"], 4), |
||
443 | type = "color", |
||
444 | desc = string.format(L["Change the %s color."], L["4th"]), |
||
445 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.longbar[4]); return r, g, b end, |
||
446 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.longbar[4] = hex end, |
||
447 | hidden = function() if BigWigsColors.db.profile.longnr < 4 then return true end end, |
||
448 | order = 4, |
||
449 | }, |
||
450 | [L["xColors"]] = { |
||
451 | name = L["Number of colors"], |
||
452 | type = "range", |
||
453 | desc = L["Number of colors the bar has."], |
||
454 | min = 1, |
||
455 | max = 4, |
||
456 | step = 1, |
||
457 | get = function() return BigWigsColors.db.profile.longnr end, |
||
458 | set = function(v) BigWigsColors.db.profile.longnr = v end, |
||
459 | order = 5, |
||
460 | }, |
||
461 | }, |
||
462 | }, |
||
463 | [L["Background"]] = { |
||
464 | name = L["Background"], |
||
465 | type = "color", |
||
466 | desc = L["Change the background color."], |
||
467 | hasAlpha = true, |
||
468 | get = function() if BigWigsColors.db.profile.bgc then local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.bgc); return r, g, b, BigWigsColors.db.profile.bga else return 0, .5, .5, .5 end end, |
||
469 | set = function(r, g, b, a) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.bgc = hex; BigWigsColors.db.profile.bga = a end, |
||
470 | order = 3, |
||
471 | }, |
||
472 | [L["Text"]] = { |
||
473 | name = L["Text"], |
||
474 | type = "color", |
||
475 | desc = L["Change the text color."], |
||
476 | get = function() if BigWigsColors.db.profile.txtc then local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.txtc); return r, g, b else return 1, 1, 1 end end, |
||
477 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.txtc = hex end, |
||
478 | order = 4, |
||
479 | }, |
||
480 | } |
||
481 | }, |
||
482 | [L["Reset"]] = { |
||
483 | name = L["Reset"], |
||
484 | type = "execute", |
||
485 | desc = L["Resets all ranges to defaults."], |
||
486 | func = function() BigWigsColors:ResetDB() end, |
||
487 | }, |
||
488 | } |
||
489 | } |
||
490 | |||
491 | ------------------------------ |
||
492 | -- Initialization -- |
||
493 | ------------------------------ |
||
494 | |||
495 | function BigWigsColors:OnRegister() |
||
496 | self:RegHex(self.db.profile) |
||
497 | end |
||
498 | |||
499 | function BigWigsColors:ResetDB() |
||
500 | BigWigsColors.db.profile.important = BigWigsColors.defaultDB.important |
||
501 | BigWigsColors.db.profile.personal = BigWigsColors.defaultDB.personal |
||
502 | BigWigsColors.db.profile.urgent = BigWigsColors.defaultDB.urgent |
||
503 | BigWigsColors.db.profile.attention = BigWigsColors.defaultDB.attention |
||
504 | BigWigsColors.db.profile.positive = BigWigsColors.defaultDB.positive |
||
505 | BigWigsColors.db.profile.bosskill = BigWigsColors.defaultDB.bosskill |
||
506 | BigWigsColors.db.profile.core = BigWigsColors.defaultDB.core |
||
507 | BigWigsColors.db.profile.shortbar[1] = BigWigsColors.defaultDB.shortbar[1] |
||
508 | BigWigsColors.db.profile.shortbar[2] = BigWigsColors.defaultDB.shortbar[2] |
||
509 | BigWigsColors.db.profile.shortbar[3] = BigWigsColors.defaultDB.shortbar[3] |
||
510 | BigWigsColors.db.profile.shortbar[4] = BigWigsColors.defaultDB.shortbar[4] |
||
511 | BigWigsColors.db.profile.shortnr = BigWigsColors.defaultDB.shortnr |
||
512 | BigWigsColors.db.profile.longbar[1] = BigWigsColors.defaultDB.longbar[1] |
||
513 | BigWigsColors.db.profile.longbar[2] = BigWigsColors.defaultDB.longbar[2] |
||
514 | BigWigsColors.db.profile.longbar[3] = BigWigsColors.defaultDB.longbar[3] |
||
515 | BigWigsColors.db.profile.longbar[4] = BigWigsColors.defaultDB.longbar[4] |
||
516 | BigWigsColors.db.profile.longnr = BigWigsColors.defaultDB.longnr |
||
517 | BigWigsColors.db.profile.bgc = BigWigsColors.defaultDB.bgc |
||
518 | BigWigsColors.db.profile.bga = BigWigsColors.defaultDB.bga |
||
519 | BigWigsColors.db.profile.txtc = BigWigsColors.defaultDB.txtc |
||
520 | end |
||
521 | |||
522 | function BigWigsColors:RegHex(hex) |
||
523 | if type(hex) == "string" then |
||
524 | PaintChips:RegisterHex(hex) |
||
525 | elseif type(hex) == "table" then |
||
526 | for _,hexx in pairs(hex) do |
||
527 | self:RegHex(hexx) |
||
528 | end |
||
529 | end |
||
530 | end |
||
531 | |||
532 | ------------------------------ |
||
533 | -- Handlers -- |
||
534 | ------------------------------ |
||
535 | |||
536 | function BigWigsColors:RGBToHex(r, g, b) |
||
537 | return format("%02x%02x%02x", r*255, g*255, b*255) |
||
538 | end |
||
539 | |||
540 | function BigWigsColors:MsgColor(type) |
||
541 | -- Make it compatible with old code |
||
542 | if type == "Red" then type = self.db.profile.important |
||
543 | elseif type == "Orange" then type = self.db.profile.urgent |
||
544 | elseif type == "Yellow" then type = self.db.profile.attention |
||
545 | elseif type == "Green" then type = self.db.profile.positive |
||
546 | elseif type == "Cyan" then type = self.db.profile.core end |
||
547 | |||
548 | if type == "Important" then type = self.db.profile.important |
||
549 | elseif type == "Personal" then type = self.db.profile.personal |
||
550 | elseif type == "Urgent" then type = self.db.profile.urgent |
||
551 | elseif type == "Attention" then type = self.db.profile.attention |
||
552 | elseif type == "Positive" then type = self.db.profile.positive |
||
553 | elseif type == "Bosskill" then type = self.db.profile.bosskill |
||
554 | elseif type == "Core" then type = self.db.profile.core end |
||
555 | |||
556 | return type |
||
557 | end |
||
558 | |||
559 | function BigWigsColors:BarColor(time) |
||
560 | local d, n |
||
561 | if time <= 60 then |
||
562 | d = self.db.profile.shortbar |
||
563 | n = self.db.profile.shortnr |
||
564 | else |
||
565 | d = self.db.profile.longbar |
||
566 | n = self.db.profile.longnr |
||
567 | end |
||
568 | if n == 4 then return d[1], d[2], d[3], d[4] |
||
569 | elseif n == 3 then return d[1], d[2], d[3] |
||
570 | elseif n == 2 then return d[1], d[2] |
||
571 | elseif n == 1 then return d[1] end |
||
572 | end |
||
573 |