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.0"):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("deDE", function() return { |
||
138 | ["Colors"] = "Farben", |
||
139 | |||
140 | ["Messages"] = "Nachrichten", |
||
141 | ["Bars"] = "Anzeigebalken", |
||
142 | ["Shortbar"] = "KurzerAnzeigebalken", |
||
143 | ["Longbar"] = "LangerAnzeigebalken", |
||
144 | ["Color %s"] = "Farbe %s", |
||
145 | ["Color%s"] = "Farbe%s", |
||
146 | ["Number of colors"] = "Anzahl der Farben", |
||
147 | ["xColors"] = "xFarben", |
||
148 | ["Background"] = "Hintergrund", |
||
149 | ["Text"] = "Text", |
||
150 | ["Reset"] = "Zur\195\188cksetzen", |
||
151 | |||
152 | ["Colors of messages and bars."] = "Farben der Nachrichten und Anzeigebalken.", |
||
153 | ["Colors of messages."] = "Farben der Nachrichten.", |
||
154 | ["Change the color for \"%s\" messages."] = "Farbe \195\164ndern f\195\188r \"%s\" Nachrichten.", |
||
155 | ["Colors of bars."] = "Farben der Leisten.", |
||
156 | ["Colors for short bars (< 1 minute)."] = "Farbe f\195\188r kurze Anzeigebalken (< 1 Minute).", |
||
157 | ["Colors for long bars (> 1 minute)."] = "Farbe f\195\188r lange Anzeigebalken (> 1 Minute).", |
||
158 | ["Change the %s color."] = "Die %s Farbe \195\164ndern.", |
||
159 | ["Number of colors the bar has."] = "Anzahl der Farben, die ein Anzeigebalken hat.", |
||
160 | ["Change the background color."] = "Hintergrund Farbe \195\164ndern.", |
||
161 | ["Change the text color."] = "Text Farbe \195\164ndern.", |
||
162 | ["Resets all ranges to defaults."] = "Auf Standard zur\195\188cksetzen.", |
||
163 | |||
164 | -- ["Important"] = true, |
||
165 | -- ["Personal"] = true, |
||
166 | -- ["Urgent"] = true, |
||
167 | -- ["Attention"] = true, |
||
168 | -- ["Positive"] = true, |
||
169 | -- ["Bosskill"] = true, |
||
170 | -- ["Core"] = true, |
||
171 | |||
172 | ["1st"] = "1te", |
||
173 | ["2nd"] = "2te", |
||
174 | ["3rd"] = "3te", |
||
175 | ["4th"] = "4te", |
||
176 | } end) |
||
177 | |||
178 | ---------------------------------- |
||
179 | -- Module Declaration -- |
||
180 | ---------------------------------- |
||
181 | |||
182 | BigWigsColors = BigWigs:NewModule(L"Colors") |
||
183 | BigWigsColors.defaultDB = { |
||
184 | important = "ff0000", -- Red |
||
185 | personal = "ff0000", -- Red |
||
186 | urgent = "ff7f00", -- Orange |
||
187 | attention = "ffff00", -- Yellow |
||
188 | positive = "00ff00", -- Green |
||
189 | bosskill = "00ff00", -- Green |
||
190 | core = "00ffff", -- Cyan |
||
191 | |||
192 | shortbar = {"ffff00", "ff7f00", "ff0000"; n=3}, |
||
193 | longbar = {"00ff00", "ffff00", "ff7f00", "ff0000"; n=4}, |
||
194 | } |
||
195 | BigWigsColors.consoleCmd = L["Colors"] |
||
196 | BigWigsColors.consoleOptions = { |
||
197 | type = "group", |
||
198 | name = L["Colors"], |
||
199 | desc = L["Colors of messages and bars."], |
||
200 | args = { |
||
201 | [L["Messages"]] = { |
||
202 | type = "group", |
||
203 | name = L["Messages"], |
||
204 | desc = L["Colors of messages."], |
||
205 | order = 1, |
||
206 | args = { |
||
207 | [L["Important"]] = { |
||
208 | name = L["Important"], |
||
209 | type = "color", |
||
210 | desc = string.format(L["Change the color for \"%s\" messages."], L["Important"]), |
||
211 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.important); return r, g, b end, |
||
212 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.important = hex end, |
||
213 | order = 1, |
||
214 | }, |
||
215 | [L["Personal"]] = { |
||
216 | name = L["Personal"], |
||
217 | type = "color", |
||
218 | desc = string.format(L["Change the color for \"%s\" messages."], L["Personal"]), |
||
219 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.personal); return r, g, b end, |
||
220 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.personal = hex end, |
||
221 | order = 2, |
||
222 | }, |
||
223 | [L["Urgent"]] = { |
||
224 | name = L["Urgent"], |
||
225 | type = "color", |
||
226 | desc = string.format(L["Change the color for \"%s\" messages."], L["Urgent"]), |
||
227 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.urgent); return r, g, b end, |
||
228 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.urgent = hex end, |
||
229 | order = 3, |
||
230 | }, |
||
231 | [L["Attention"]] = { |
||
232 | name = L["Attention"], |
||
233 | type = "color", |
||
234 | desc = string.format(L["Change the color for \"%s\" messages."], L["Attention"]), |
||
235 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.attention); return r, g, b end, |
||
236 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.attention = hex end, |
||
237 | order = 4, |
||
238 | }, |
||
239 | [L["Positive"]] = { |
||
240 | name = L["Positive"], |
||
241 | type = "color", |
||
242 | desc = string.format(L["Change the color for \"%s\" messages."], L["Positive"]), |
||
243 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.positive); return r, g, b end, |
||
244 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.positive = hex end, |
||
245 | order = 5, |
||
246 | }, |
||
247 | [L["Bosskill"]] = { |
||
248 | name = L["Bosskill"], |
||
249 | type = "color", |
||
250 | desc = string.format(L["Change the color for \"%s\" messages."], L["Bosskill"]), |
||
251 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.bosskill); return r, g, b end, |
||
252 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.bosskill = hex end, |
||
253 | order = 6, |
||
254 | }, |
||
255 | [L["Core"]] = { |
||
256 | name = L["Core"], |
||
257 | type = "color", |
||
258 | desc = string.format(L["Change the color for \"%s\" messages."], L["Core"]), |
||
259 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.core); return r, g, b end, |
||
260 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.core = hex end, |
||
261 | order = 7, |
||
262 | }, |
||
263 | }, |
||
264 | }, |
||
265 | [L["Bars"]] = { |
||
266 | type = "group", |
||
267 | name = L["Bars"], |
||
268 | desc = L["Colors of bars."], |
||
269 | order = 2, |
||
270 | args = { |
||
271 | [L"Shortbar"] = { |
||
272 | type = "group", |
||
273 | name = L["Shortbar"], |
||
274 | desc = L["Colors for short bars (< 1 minute)."], |
||
275 | order = 1, |
||
276 | args = { |
||
277 | [string.format(L["Color%s"], 1)] = { |
||
278 | name = string.format(L["Color %s"], 1), |
||
279 | type = "color", |
||
280 | desc = string.format(L["Change the %s color."], L["1st"]), |
||
281 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.shortbar[1]); return r, g, b end, |
||
282 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.shortbar[1] = hex end, |
||
283 | order = 1, |
||
284 | }, |
||
285 | [string.format(L["Color%s"], 2)] = { |
||
286 | name = string.format(L["Color %s"], 2), |
||
287 | type = "color", |
||
288 | desc = string.format(L["Change the %s color."], L["2nd"]), |
||
289 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.shortbar[2]); return r, g, b end, |
||
290 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.shortbar[2] = hex end, |
||
291 | hidden = function() if getn(BigWigsColors.db.profile.shortbar) < 2 then return true end end, |
||
292 | order = 2, |
||
293 | }, |
||
294 | [string.format(L["Color%s"], 3)] = { |
||
295 | name = string.format(L["Color %s"], 3), |
||
296 | type = "color", |
||
297 | desc = string.format(L["Change the %s color."], L["3rd"]), |
||
298 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.shortbar[3]); return r, g, b end, |
||
299 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.shortbar[3] = hex end, |
||
300 | hidden = function() if getn(BigWigsColors.db.profile.shortbar) < 3 then return true end end, |
||
301 | order = 3, |
||
302 | }, |
||
303 | [string.format(L["Color%s"], 4)] = { |
||
304 | name = string.format(L["Color %s"], 4), |
||
305 | type = "color", |
||
306 | desc = string.format(L["Change the %s color."], L["4th"]), |
||
307 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.shortbar[4]); return r, g, b end, |
||
308 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.shortbar[4] = hex end, |
||
309 | hidden = function() if getn(BigWigsColors.db.profile.shortbar) < 4 then return true end end, |
||
310 | order = 4, |
||
311 | }, |
||
312 | [L["xColors"]] = { |
||
313 | name = L["Number of colors"], |
||
314 | type = "range", |
||
315 | desc = L["Number of colors the bar has."], |
||
316 | min = 1, |
||
317 | max = 4, |
||
318 | step = 1, |
||
319 | get = function() return getn(BigWigsColors.db.profile.shortbar) end, |
||
320 | set = function(v) table.setn(BigWigsColors.db.profile.shortbar, v) end, |
||
321 | order = 5, |
||
322 | }, |
||
323 | }, |
||
324 | }, |
||
325 | [L["Longbar"]] = { |
||
326 | type = "group", |
||
327 | name = L["Longbar"], |
||
328 | desc = L["Colors for long bars (> 1 minute)."], |
||
329 | order = 2, |
||
330 | args = { |
||
331 | [string.format(L["Color%s"], 1)] = { |
||
332 | name = string.format(L["Color %s"], 1), |
||
333 | type = "color", |
||
334 | desc = string.format(L["Change the %s color."], L["1st"]), |
||
335 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.longbar[1]); return r, g, b end, |
||
336 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.longbar[1] = hex end, |
||
337 | order = 1, |
||
338 | }, |
||
339 | [string.format(L["Color%s"], 2)] = { |
||
340 | name = string.format(L["Color %s"], 2), |
||
341 | type = "color", |
||
342 | desc = string.format(L["Change the %s color."], L["2nd"]), |
||
343 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.longbar[2]); return r, g, b end, |
||
344 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.longbar[2] = hex end, |
||
345 | hidden = function() if getn(BigWigsColors.db.profile.longbar) < 2 then return true end end, |
||
346 | order = 2, |
||
347 | }, |
||
348 | [string.format(L["Color%s"], 3)] = { |
||
349 | name = string.format(L["Color %s"], 3), |
||
350 | type = "color", |
||
351 | desc = string.format(L["Change the %s color."], L["3rd"]), |
||
352 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.longbar[3]); return r, g, b end, |
||
353 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.longbar[3] = hex end, |
||
354 | hidden = function() if getn(BigWigsColors.db.profile.longbar) < 3 then return true end end, |
||
355 | order = 3, |
||
356 | }, |
||
357 | [string.format(L["Color%s"], 4)] = { |
||
358 | name = string.format(L["Color %s"], 4), |
||
359 | type = "color", |
||
360 | desc = string.format(L["Change the %s color."], L["4th"]), |
||
361 | get = function() local _, r, g, b = PaintChips:GetRGBPercent(BigWigsColors.db.profile.longbar[4]); return r, g, b end, |
||
362 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.longbar[4] = hex end, |
||
363 | hidden = function() if getn(BigWigsColors.db.profile.longbar) < 4 then return true end end, |
||
364 | order = 4, |
||
365 | }, |
||
366 | [L["xColors"]] = { |
||
367 | name = L["Number of colors"], |
||
368 | type = "range", |
||
369 | desc = L["Number of colors the bar has."], |
||
370 | min = 1, |
||
371 | max = 4, |
||
372 | step = 1, |
||
373 | get = function() return getn(BigWigsColors.db.profile.longbar) end, |
||
374 | set = function(v) table.setn(BigWigsColors.db.profile.longbar, v) end, |
||
375 | order = 5, |
||
376 | }, |
||
377 | }, |
||
378 | }, |
||
379 | [L["Background"]] = { |
||
380 | name = L["Background"], |
||
381 | type = "color", |
||
382 | desc = L["Change the background color."], |
||
383 | hasAlpha = true, |
||
384 | 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, |
||
385 | 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, |
||
386 | order = 3, |
||
387 | }, |
||
388 | [L["Text"]] = { |
||
389 | name = L["Text"], |
||
390 | type = "color", |
||
391 | desc = L["Change the text color."], |
||
392 | 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, |
||
393 | set = function(r, g, b) local hex = BigWigsColors:RGBToHex(r, g, b); PaintChips:RegisterHex(hex); BigWigsColors.db.profile.txtc = hex end, |
||
394 | order = 4, |
||
395 | }, |
||
396 | } |
||
397 | }, |
||
398 | [L["Reset"]] = { |
||
399 | name = L["Reset"], |
||
400 | type = "execute", |
||
401 | desc = L["Resets all ranges to defaults."], |
||
402 | func = function() BigWigsColors:ResetDB() end, |
||
403 | }, |
||
404 | } |
||
405 | } |
||
406 | |||
407 | ------------------------------ |
||
408 | -- Initialization -- |
||
409 | ------------------------------ |
||
410 | |||
411 | function BigWigsColors:OnInitialize() |
||
412 | self:RegHex(self.db.profile) |
||
413 | end |
||
414 | |||
415 | function BigWigsColors:ResetDB() |
||
416 | BigWigsColors.db.profile.important = BigWigsColors.defaultDB.important |
||
417 | BigWigsColors.db.profile.personal = BigWigsColors.defaultDB.personal |
||
418 | BigWigsColors.db.profile.urgent = BigWigsColors.defaultDB.urgent |
||
419 | BigWigsColors.db.profile.attention = BigWigsColors.defaultDB.attention |
||
420 | BigWigsColors.db.profile.positive = BigWigsColors.defaultDB.positive |
||
421 | BigWigsColors.db.profile.bosskill = BigWigsColors.defaultDB.bosskill |
||
422 | BigWigsColors.db.profile.core = BigWigsColors.defaultDB.core |
||
423 | BigWigsColors.db.profile.shortbar[1] = BigWigsColors.defaultDB.shortbar[1] |
||
424 | BigWigsColors.db.profile.shortbar[2] = BigWigsColors.defaultDB.shortbar[2] |
||
425 | BigWigsColors.db.profile.shortbar[3] = BigWigsColors.defaultDB.shortbar[3] |
||
426 | BigWigsColors.db.profile.shortbar[4] = BigWigsColors.defaultDB.shortbar[4] |
||
427 | table.setn(BigWigsColors.db.profile.shortbar, getn(BigWigsColors.defaultDB.shortbar)) |
||
428 | BigWigsColors.db.profile.longbar[1] = BigWigsColors.defaultDB.longbar[1] |
||
429 | BigWigsColors.db.profile.longbar[2] = BigWigsColors.defaultDB.longbar[2] |
||
430 | BigWigsColors.db.profile.longbar[3] = BigWigsColors.defaultDB.longbar[3] |
||
431 | BigWigsColors.db.profile.longbar[4] = BigWigsColors.defaultDB.longbar[4] |
||
432 | table.setn(BigWigsColors.db.profile.longbar, getn(BigWigsColors.defaultDB.longbar)) |
||
433 | BigWigsColors.db.profile.bgc = BigWigsColors.defaultDB.bgc |
||
434 | BigWigsColors.db.profile.bga = BigWigsColors.defaultDB.bga |
||
435 | BigWigsColors.db.profile.txtc = BigWigsColors.defaultDB.txtc |
||
436 | end |
||
437 | |||
438 | function BigWigsColors:RegHex(hex) |
||
439 | if type(hex) == "string" then |
||
440 | PaintChips:RegisterHex(hex) |
||
441 | elseif type(hex) == "table" then |
||
442 | for _,hexx in hex do |
||
443 | self:RegHex(hexx) |
||
444 | end |
||
445 | end |
||
446 | end |
||
447 | |||
448 | ------------------------------ |
||
449 | -- Handlers -- |
||
450 | ------------------------------ |
||
451 | |||
452 | function BigWigsColors:RGBToHex(r, g, b) |
||
453 | return format("%02x%02x%02x", r*255, g*255, b*255) |
||
454 | end |
||
455 | |||
456 | function BigWigsColors:MsgColor(type) |
||
457 | -- Make it compatible with old code |
||
458 | if type == "Red" then type = self.db.profile.important |
||
459 | elseif type == "Orange" then type = self.db.profile.urgent |
||
460 | elseif type == "Yellow" then type = self.db.profile.attention |
||
461 | elseif type == "Green" then type = self.db.profile.positive |
||
462 | elseif type == "Cyan" then type = self.db.profile.core end |
||
463 | |||
464 | if type == "Important" then type = self.db.profile.important |
||
465 | elseif type == "Personal" then type = self.db.profile.personal |
||
466 | elseif type == "Urgent" then type = self.db.profile.urgent |
||
467 | elseif type == "Attention" then type = self.db.profile.attention |
||
468 | elseif type == "Positive" then type = self.db.profile.positive |
||
469 | elseif type == "Bosskill" then type = self.db.profile.bosskill |
||
470 | elseif type == "Core" then type = self.db.profile.core end |
||
471 | |||
472 | return type |
||
473 | end |
||
474 | |||
475 | function BigWigsColors:BarColor(time) |
||
476 | local d = time <= 60 and self.db.profile.shortbar or self.db.profile.longbar |
||
477 | local n = getn(d) |
||
478 | if n == 4 then return d[1], d[2], d[3], d[4] |
||
479 | elseif n == 3 then return d[1], d[2], d[3] |
||
480 | elseif n == 2 then return d[1], d[2] |
||
481 | elseif n == 1 then return d[1] end |
||
482 | end |