vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | -- plein de trucs |
2 | |||
3 | PowaSavedBuff = {}; |
||
4 | PowaSavedDebuff = {}; |
||
5 | PowaSavedDebuffType = {}; |
||
6 | |||
7 | CurrentPage = 0; |
||
8 | |||
9 | CurrentPageType ="Buff"; |
||
10 | |||
11 | -- ----------------------------------------------------------------------- |
||
12 | function Powa_UpdateList() |
||
13 | local j = 0; |
||
14 | if (CurrentPageType == "Debuff") then -- un debuff |
||
15 | for i = 1, 10 do |
||
16 | j = (CurrentPage * 10) + i; |
||
17 | if (PowaSavedDebuff[j]) then |
||
18 | getglobal("PowaListLigne"..i.."_text"):SetText(PowaSavedDebuff[j].buffname); |
||
19 | getglobal("PowaListLigne"..i.."_text"):SetTextColor(1.0, 0.5, 0.5); |
||
20 | getglobal("PowaListLigne"..i.."_buttondelete"):Show(); |
||
21 | getglobal("PowaListLigne"..i.."_buttondelete").num = j; |
||
22 | getglobal("PowaListLigne"..i.."_buttonload"):Show(); |
||
23 | getglobal("PowaListLigne"..i.."_buttonload").num = j; |
||
24 | getglobal("PowaListLigne"..i.."_buttontest"):Show(); |
||
25 | getglobal("PowaListLigne"..i.."_buttontest").num = j; |
||
26 | else |
||
27 | getglobal("PowaListLigne"..i.."_text"):SetTextColor(0.5, 0.25, 0.25); |
||
28 | getglobal("PowaListLigne"..i.."_text"):SetText("-vide-"); |
||
29 | getglobal("PowaListLigne"..i.."_buttondelete"):Hide(); |
||
30 | getglobal("PowaListLigne"..i.."_buttonload"):Hide(); |
||
31 | getglobal("PowaListLigne"..i.."_buttontest"):Hide(); |
||
32 | end |
||
33 | end |
||
34 | elseif (CurrentPageType == "DebuffType") then -- un type de debuff |
||
35 | for i = 1, 10 do |
||
36 | j = (CurrentPage * 10) + i; |
||
37 | if (PowaSavedDebuffType[j]) then |
||
38 | getglobal("PowaListLigne"..i.."_text"):SetText(PowaSavedDebuffType[j].buffname); |
||
39 | getglobal("PowaListLigne"..i.."_text"):SetTextColor(1.0, 1.0, 0.5); |
||
40 | getglobal("PowaListLigne"..i.."_buttondelete"):Show(); |
||
41 | getglobal("PowaListLigne"..i.."_buttondelete").num = j; |
||
42 | getglobal("PowaListLigne"..i.."_buttonload"):Show(); |
||
43 | getglobal("PowaListLigne"..i.."_buttonload").num = j; |
||
44 | getglobal("PowaListLigne"..i.."_buttontest"):Show(); |
||
45 | getglobal("PowaListLigne"..i.."_buttontest").num = j; |
||
46 | else |
||
47 | getglobal("PowaListLigne"..i.."_text"):SetText("-vide-"); |
||
48 | getglobal("PowaListLigne"..i.."_text"):SetTextColor(0.5, 0.5, 0.25); |
||
49 | getglobal("PowaListLigne"..i.."_buttondelete"):Hide(); |
||
50 | getglobal("PowaListLigne"..i.."_buttonload"):Hide(); |
||
51 | getglobal("PowaListLigne"..i.."_buttontest"):Hide(); |
||
52 | end |
||
53 | end |
||
54 | else -- un buff donc |
||
55 | for i = 1, 10 do |
||
56 | j = (CurrentPage * 10) + i; |
||
57 | if (PowaSavedBuff[j]) then |
||
58 | getglobal("PowaListLigne"..i.."_text"):SetText(PowaSavedBuff[j].buffname); |
||
59 | getglobal("PowaListLigne"..i.."_text"):SetTextColor(0.5, 1.0, 0.5); |
||
60 | getglobal("PowaListLigne"..i.."_buttondelete"):Show(); |
||
61 | getglobal("PowaListLigne"..i.."_buttondelete").num = j; |
||
62 | getglobal("PowaListLigne"..i.."_buttonload"):Show(); |
||
63 | getglobal("PowaListLigne"..i.."_buttonload").num = j; |
||
64 | getglobal("PowaListLigne"..i.."_buttontest"):Show(); |
||
65 | getglobal("PowaListLigne"..i.."_buttontest").num = j; |
||
66 | else |
||
67 | getglobal("PowaListLigne"..i.."_text"):SetText("-vide-"); |
||
68 | getglobal("PowaListLigne"..i.."_text"):SetTextColor(0.25, 0.5, 0.25); |
||
69 | getglobal("PowaListLigne"..i.."_buttondelete"):Hide(); |
||
70 | getglobal("PowaListLigne"..i.."_buttonload"):Hide(); |
||
71 | getglobal("PowaListLigne"..i.."_buttontest"):Hide(); |
||
72 | end |
||
73 | end |
||
74 | end |
||
75 | end |
||
76 | |||
77 | -- ----------------------------------------------------------------------- |
||
78 | function Powa_GetSavePosition() |
||
79 | |||
80 | if (PowaSet[CurrentAura].buffname == "" or PowaSet[CurrentAura].buffname == " ") then |
||
81 | DEFAULT_CHAT_FRAME:AddMessage("|cffB0A0ff<Power Auras>|r|cffff8080 "..PowaText.erreur1.."|r"); |
||
82 | return 0; |
||
83 | end |
||
84 | |||
85 | if (PowaSet[CurrentAura].isdebuff) then -- un debuff |
||
86 | for i=1, 100 do |
||
87 | if (PowaSavedDebuff[i]) then |
||
88 | if (PowaSavedDebuff[i].buffname == PowaSet[CurrentAura].buffname) then |
||
89 | DEFAULT_CHAT_FRAME:AddMessage("|cffB0A0ff<Power Auras>|r|cffff8080 "..PowaText.erreur2.."|r"); |
||
90 | return 0; |
||
91 | end |
||
92 | else |
||
93 | return i; |
||
94 | end |
||
95 | end |
||
96 | elseif (PowaSet[CurrentAura].isdebufftype) then -- un type de debuff |
||
97 | for i=1, 10 do |
||
98 | if (PowaSavedDebuffType[i]) then |
||
99 | if (PowaSavedDebuffType[i].buffname == PowaSet[CurrentAura].buffname) then |
||
100 | DEFAULT_CHAT_FRAME:AddMessage("|cffB0A0ff<Power Auras>|r|cffff8080 "..PowaText.erreur2.."|r"); |
||
101 | return 0; |
||
102 | end |
||
103 | else |
||
104 | return i; |
||
105 | end |
||
106 | end |
||
107 | else -- un buff donc |
||
108 | for i=1, 100 do |
||
109 | if (PowaSavedBuff[i]) then |
||
110 | if (PowaSavedBuff[i].buffname == PowaSet[CurrentAura].buffname) then |
||
111 | DEFAULT_CHAT_FRAME:AddMessage("|cffB0A0ff<Power Auras>|r|cffff8080 "..PowaText.erreur2.."|r"); |
||
112 | return 0; |
||
113 | end |
||
114 | else |
||
115 | return i; |
||
116 | end |
||
117 | end |
||
118 | end |
||
119 | DEFAULT_CHAT_FRAME:AddMessage("|cffB0A0ff<Power Auras>|r|cffff8080 "..PowaText.erreur3.."|r"); |
||
120 | return 0; |
||
121 | end |
||
122 | |||
123 | -- ------------------------------------------ Sauve un effet dans la liste |
||
124 | function Powa_SaveEffect() |
||
125 | local SavePosition = 0; |
||
126 | |||
127 | if (PowaSet[CurrentAura].isdebuff) then -- un debuff |
||
128 | SavePosition = Powa_GetSavePosition(); |
||
129 | if (SavePosition == 0) then return; end |
||
130 | -- copie tout donc |
||
131 | PowaSavedDebuff[SavePosition] = { |
||
132 | texture = PowaSet[CurrentAura].texture, |
||
133 | anim1 = PowaSet[CurrentAura].anim1, |
||
134 | anim2 = PowaSet[CurrentAura].anim2, |
||
135 | speed = PowaSet[CurrentAura].speed, |
||
136 | begin = PowaSet[CurrentAura].begin, |
||
137 | duration = PowaSet[CurrentAura].duration, |
||
138 | alpha = PowaSet[CurrentAura].alpha, |
||
139 | size = PowaSet[CurrentAura].size, |
||
140 | torsion = PowaSet[CurrentAura].torsion, |
||
141 | symetrie = PowaSet[CurrentAura].symetrie, |
||
142 | x = PowaSet[CurrentAura].x, |
||
143 | y = PowaSet[CurrentAura].y, |
||
144 | buffname = PowaSet[CurrentAura].buffname, |
||
145 | isdebuff = PowaSet[CurrentAura].isdebuff, |
||
146 | isdebufftype = PowaSet[CurrentAura].isdebufftype, |
||
147 | timer = PowaSet[CurrentAura].timer, |
||
148 | inverse = PowaSet[CurrentAura].inverse, |
||
149 | r = PowaSet[CurrentAura].r, |
||
150 | g = PowaSet[CurrentAura].g, |
||
151 | b = PowaSet[CurrentAura].b |
||
152 | } |
||
153 | CurrentPageType ="Debuff"; |
||
154 | Powa_ChangeCurrentPage( math.ceil(SavePosition / 10) - 1 ) |
||
155 | Powa_UpdateList(); |
||
156 | |||
157 | elseif (PowaSet[CurrentAura].isdebufftype) then -- un type de debuff |
||
158 | SavePosition = Powa_GetSavePosition(); |
||
159 | if (SavePosition == 0) then return; end |
||
160 | -- copie tout donc |
||
161 | PowaSavedDebuffType[SavePosition] = { |
||
162 | texture = PowaSet[CurrentAura].texture, |
||
163 | anim1 = PowaSet[CurrentAura].anim1, |
||
164 | anim2 = PowaSet[CurrentAura].anim2, |
||
165 | speed = PowaSet[CurrentAura].speed, |
||
166 | begin = PowaSet[CurrentAura].begin, |
||
167 | duration = PowaSet[CurrentAura].duration, |
||
168 | alpha = PowaSet[CurrentAura].alpha, |
||
169 | size = PowaSet[CurrentAura].size, |
||
170 | torsion = PowaSet[CurrentAura].torsion, |
||
171 | symetrie = PowaSet[CurrentAura].symetrie, |
||
172 | x = PowaSet[CurrentAura].x, |
||
173 | y = PowaSet[CurrentAura].y, |
||
174 | buffname = PowaSet[CurrentAura].buffname, |
||
175 | isdebuff = PowaSet[CurrentAura].isdebuff, |
||
176 | isdebufftype = PowaSet[CurrentAura].isdebufftype, |
||
177 | timer = PowaSet[CurrentAura].timer, |
||
178 | inverse = PowaSet[CurrentAura].inverse, |
||
179 | r = PowaSet[CurrentAura].r, |
||
180 | g = PowaSet[CurrentAura].g, |
||
181 | b = PowaSet[CurrentAura].b |
||
182 | } |
||
183 | CurrentPageType ="DebuffType"; |
||
184 | Powa_ChangeCurrentPage( math.ceil(SavePosition / 10) - 1 ) |
||
185 | Powa_UpdateList(); |
||
186 | |||
187 | else -- un buff donc |
||
188 | SavePosition = Powa_GetSavePosition(); |
||
189 | if (SavePosition == 0) then return; end |
||
190 | -- copie tout donc |
||
191 | PowaSavedBuff[SavePosition] = { |
||
192 | texture = PowaSet[CurrentAura].texture, |
||
193 | anim1 = PowaSet[CurrentAura].anim1, |
||
194 | anim2 = PowaSet[CurrentAura].anim2, |
||
195 | speed = PowaSet[CurrentAura].speed, |
||
196 | begin = PowaSet[CurrentAura].begin, |
||
197 | duration = PowaSet[CurrentAura].duration, |
||
198 | alpha = PowaSet[CurrentAura].alpha, |
||
199 | size = PowaSet[CurrentAura].size, |
||
200 | torsion = PowaSet[CurrentAura].torsion, |
||
201 | symetrie = PowaSet[CurrentAura].symetrie, |
||
202 | x = PowaSet[CurrentAura].x, |
||
203 | y = PowaSet[CurrentAura].y, |
||
204 | buffname = PowaSet[CurrentAura].buffname, |
||
205 | isdebuff = PowaSet[CurrentAura].isdebuff, |
||
206 | isdebufftype = PowaSet[CurrentAura].isdebufftype, |
||
207 | timer = PowaSet[CurrentAura].timer, |
||
208 | inverse = PowaSet[CurrentAura].inverse, |
||
209 | r = PowaSet[CurrentAura].r, |
||
210 | g = PowaSet[CurrentAura].g, |
||
211 | b = PowaSet[CurrentAura].b |
||
212 | } |
||
213 | CurrentPageType ="Buff"; |
||
214 | Powa_ChangeCurrentPage( math.ceil(SavePosition / 10) - 1 ) |
||
215 | Powa_UpdateList(); |
||
216 | end |
||
217 | end |
||
218 | |||
219 | -- ------------------------------------------------------------------------------ |
||
220 | |||
221 | function Powa_CopyEffect(Pfrom, Pto) |
||
222 | -- utilise la page en cours |
||
223 | if (CurrentPageType == "Debuff") then -- un debuff |
||
224 | PowaSet[Pto].texture = PowaSavedDebuff[Pfrom].texture; |
||
225 | PowaSet[Pto].anim1 = PowaSavedDebuff[Pfrom].anim1; |
||
226 | PowaSet[Pto].anim2 = PowaSavedDebuff[Pfrom].anim2; |
||
227 | PowaSet[Pto].speed = PowaSavedDebuff[Pfrom].speed; |
||
228 | PowaSet[Pto].begin = PowaSavedDebuff[Pfrom].begin; |
||
229 | PowaSet[Pto].duration = PowaSavedDebuff[Pfrom].duration; |
||
230 | PowaSet[Pto].alpha = PowaSavedDebuff[Pfrom].alpha; |
||
231 | PowaSet[Pto].size = PowaSavedDebuff[Pfrom].size; |
||
232 | PowaSet[Pto].torsion = PowaSavedDebuff[Pfrom].torsion; |
||
233 | PowaSet[Pto].symetrie = PowaSavedDebuff[Pfrom].symetrie; |
||
234 | PowaSet[Pto].x = PowaSavedDebuff[Pfrom].x; |
||
235 | PowaSet[Pto].y = PowaSavedDebuff[Pfrom].y; |
||
236 | PowaSet[Pto].buffname = PowaSavedDebuff[Pfrom].buffname; |
||
237 | PowaSet[Pto].isdebuff = PowaSavedDebuff[Pfrom].isdebuff; |
||
238 | PowaSet[Pto].isdebufftype = PowaSavedDebuff[Pfrom].isdebufftype; |
||
239 | PowaSet[Pto].timer = PowaSavedDebuff[Pfrom].timer; |
||
240 | PowaSet[Pto].inverse = PowaSavedDebuff[Pfrom].inverse; |
||
241 | PowaSet[Pto].r = PowaSavedDebuff[Pfrom].r; |
||
242 | PowaSet[Pto].g = PowaSavedDebuff[Pfrom].g; |
||
243 | PowaSet[Pto].b = PowaSavedDebuff[Pfrom].b; |
||
244 | |||
245 | elseif (CurrentPageType == "DebuffType") then -- un debuff |
||
246 | PowaSet[Pto].texture = PowaSavedDebuffType[Pfrom].texture; |
||
247 | PowaSet[Pto].anim1 = PowaSavedDebuffType[Pfrom].anim1; |
||
248 | PowaSet[Pto].anim2 = PowaSavedDebuffType[Pfrom].anim2; |
||
249 | PowaSet[Pto].speed = PowaSavedDebuffType[Pfrom].speed; |
||
250 | PowaSet[Pto].begin = PowaSavedDebuffType[Pfrom].begin; |
||
251 | PowaSet[Pto].duration = PowaSavedDebuffType[Pfrom].duration; |
||
252 | PowaSet[Pto].alpha = PowaSavedDebuffType[Pfrom].alpha; |
||
253 | PowaSet[Pto].size = PowaSavedDebuffType[Pfrom].size; |
||
254 | PowaSet[Pto].torsion = PowaSavedDebuffType[Pfrom].torsion; |
||
255 | PowaSet[Pto].symetrie = PowaSavedDebuffType[Pfrom].symetrie; |
||
256 | PowaSet[Pto].x = PowaSavedDebuffType[Pfrom].x; |
||
257 | PowaSet[Pto].y = PowaSavedDebuffType[Pfrom].y; |
||
258 | PowaSet[Pto].buffname = PowaSavedDebuffType[Pfrom].buffname; |
||
259 | PowaSet[Pto].isdebuff = PowaSavedDebuffType[Pfrom].isdebuff; |
||
260 | PowaSet[Pto].isdebufftype = PowaSavedDebuffType[Pfrom].isdebufftype; |
||
261 | PowaSet[Pto].timer = PowaSavedDebuffType[Pfrom].timer; |
||
262 | PowaSet[Pto].inverse = PowaSavedDebuffType[Pfrom].inverse; |
||
263 | PowaSet[Pto].r = PowaSavedDebuffType[Pfrom].r; |
||
264 | PowaSet[Pto].g = PowaSavedDebuffType[Pfrom].g; |
||
265 | PowaSet[Pto].b = PowaSavedDebuffType[Pfrom].b; |
||
266 | else |
||
267 | PowaSet[Pto].texture = PowaSavedBuff[Pfrom].texture; |
||
268 | PowaSet[Pto].anim1 = PowaSavedBuff[Pfrom].anim1; |
||
269 | PowaSet[Pto].anim2 = PowaSavedBuff[Pfrom].anim2; |
||
270 | PowaSet[Pto].speed = PowaSavedBuff[Pfrom].speed; |
||
271 | PowaSet[Pto].begin = PowaSavedBuff[Pfrom].begin; |
||
272 | PowaSet[Pto].duration = PowaSavedBuff[Pfrom].duration; |
||
273 | PowaSet[Pto].alpha = PowaSavedBuff[Pfrom].alpha; |
||
274 | PowaSet[Pto].size = PowaSavedBuff[Pfrom].size; |
||
275 | PowaSet[Pto].torsion = PowaSavedBuff[Pfrom].torsion; |
||
276 | PowaSet[Pto].symetrie = PowaSavedBuff[Pfrom].symetrie; |
||
277 | PowaSet[Pto].x = PowaSavedBuff[Pfrom].x; |
||
278 | PowaSet[Pto].y = PowaSavedBuff[Pfrom].y; |
||
279 | PowaSet[Pto].buffname = PowaSavedBuff[Pfrom].buffname; |
||
280 | PowaSet[Pto].isdebuff = PowaSavedBuff[Pfrom].isdebuff; |
||
281 | PowaSet[Pto].isdebufftype = PowaSavedBuff[Pfrom].isdebufftype; |
||
282 | PowaSet[Pto].timer = PowaSavedBuff[Pfrom].timer; |
||
283 | PowaSet[Pto].inverse = PowaSavedBuff[Pfrom].inverse; |
||
284 | PowaSet[Pto].r = PowaSavedBuff[Pfrom].r; |
||
285 | PowaSet[Pto].g = PowaSavedBuff[Pfrom].g; |
||
286 | PowaSet[Pto].b = PowaSavedBuff[Pfrom].b; |
||
287 | end |
||
288 | |||
289 | -- gere les rajouts : |
||
290 | if (PowaSet[Pto].duration == nil) then PowaSet[Pto].duration = 0; end |
||
291 | if (PowaSet[Pto].begin == nil) then PowaSet[Pto].begin = 0; end |
||
292 | if (PowaSet[Pto].timer == nil) then PowaSet[Pto].timer = false; end |
||
293 | if (PowaSet[Pto].inverse == nil) then PowaSet[Pto].inverse = false; end |
||
294 | if (PowaSet[Pto].speed == nil) then PowaSet[Pto].speed = 1.0; end |
||
295 | end |
||
296 | |||
297 | -- ------------------------------------------------------------------------------ |
||
298 | |||
299 | function Powa_ListeLoadEffect(PBouton) |
||
300 | if (PBouton.num) then |
||
301 | Powa_CopyEffect(PBouton.num, CurrentAura); |
||
302 | Powa_InitPage(); -- change la page des options d'effet en cours |
||
303 | end |
||
304 | end |
||
305 | |||
306 | -- ------------------------------------------------------------------------------ |
||
307 | |||
308 | function Powa_ListeTestEffect(PBouton) |
||
309 | |||
310 | if (PBouton.num) then |
||
311 | -- copie les infos enregistrees dans l'effet de test |
||
312 | Powa_CopyEffect(PBouton.num, CurrentTestAura); |
||
313 | |||
314 | -- supprime le nom du buff ceci dit |
||
315 | PowaSet[CurrentTestAura].buffname = ""; |
||
316 | |||
317 | -- affiche |
||
318 | if (Powa_Frames[CurrentTestAura]:IsVisible()) then -- deja visible, on la cache |
||
319 | Powa_FramesVisibleTime[CurrentTestAura] = 0; |
||
320 | Powa_FramesVisibleTime[SecondeAura] = 0; |
||
321 | else -- pas visible alors on affiche |
||
322 | Powa_DisplayAura(CurrentTestAura); |
||
323 | end |
||
324 | end |
||
325 | end |
||
326 | |||
327 | -- ------------------------------------------------------------------------------ |
||
328 | |||
329 | function Powa_NoSpacesInList() |
||
330 | local a; |
||
331 | |||
332 | a = 1; |
||
333 | if (CurrentPageType == "Debuff") then -- un debuff |
||
334 | for i = 1, 100 do |
||
335 | if (PowaSavedDebuff[i]) then |
||
336 | PowaSavedDebuff[a] = PowaSavedDebuff[i]; |
||
337 | if (i>a) then |
||
338 | PowaSavedDebuff[i] = nil; |
||
339 | end |
||
340 | a = a+1; |
||
341 | end |
||
342 | end |
||
343 | elseif (CurrentPageType == "DebuffType") then -- un debuff |
||
344 | for i = 1, 10 do |
||
345 | if (PowaSavedDebuffType[i]) then |
||
346 | PowaSavedDebuffType[a] = PowaSavedDebuffType[i]; |
||
347 | if (i>a) then |
||
348 | PowaSavedDebuffType[i] = nil; |
||
349 | end |
||
350 | a = a+1; |
||
351 | end |
||
352 | end |
||
353 | else |
||
354 | for i = 1, 100 do |
||
355 | if (PowaSavedBuff[i]) then |
||
356 | PowaSavedBuff[a] = PowaSavedBuff[i]; |
||
357 | if (i>a) then |
||
358 | PowaSavedBuff[i] = nil; |
||
359 | end |
||
360 | a = a+1; |
||
361 | end |
||
362 | end |
||
363 | end |
||
364 | end |
||
365 | |||
366 | -- ------------------------------------------------------------------------------ |
||
367 | |||
368 | function Powa_ListeDeleteEffect(PBouton) |
||
369 | |||
370 | if (PBouton.num) then |
||
371 | if (CurrentPageType == "Debuff") then -- un debuff |
||
372 | PowaSavedDebuff[PBouton.num] = nil; |
||
373 | elseif (CurrentPageType == "DebuffType") then -- un debuff |
||
374 | PowaSavedDebuffType[PBouton.num] = nil; |
||
375 | else |
||
376 | PowaSavedBuff[PBouton.num] = nil; |
||
377 | end |
||
378 | Powa_NoSpacesInList(); |
||
379 | Powa_UpdateList(); |
||
380 | end |
||
381 | end |
||
382 | |||
383 | -- ------------------------------------------------------------------------------ |
||
384 | |||
385 | function Powa_ChangeCurrentPage(Pnum, Pname) |
||
386 | CurrentPage = Pnum; |
||
387 | getglobal("PowaListPage"):SetText("Page "..(CurrentPage+1).."/10"); |
||
388 | -- si un type de debuff, y'a qu'une page |
||
389 | if (Pname == "DebuffType") then |
||
390 | getglobal("PowaListPage"):Hide(); |
||
391 | getglobal("powa_listprevious"):Hide(); |
||
392 | getglobal("powa_listnext"):Hide(); |
||
393 | else |
||
394 | getglobal("PowaListPage"):Show(); |
||
395 | getglobal("powa_listprevious"):Show(); |
||
396 | getglobal("powa_listnext"):Show(); |
||
397 | end |
||
398 | end |
||
399 | |||
400 | function Powa_ChangeListNext() |
||
401 | |||
402 | if (CurrentPage < 9) then |
||
403 | Powa_ChangeCurrentPage(CurrentPage+1); |
||
404 | Powa_UpdateList(); |
||
405 | end |
||
406 | end |
||
407 | |||
408 | function Powa_ChangeListPrev() |
||
409 | |||
410 | if (CurrentPage > 0) then |
||
411 | Powa_ChangeCurrentPage(CurrentPage-1); |
||
412 | Powa_UpdateList(); |
||
413 | end |
||
414 | end |
||
415 | |||
416 | function Powa_ListChangeType(Pname) |
||
417 | CurrentPageType = Pname; |
||
418 | Powa_ChangeCurrentPage(0,Pname); |
||
419 | Powa_UpdateList(); |
||
420 | end |
||
421 | |||
422 | -- ------------------------------------------------------------------------------ |
||
423 | |||
424 | function Powa_ShowList() |
||
425 | if (getglobal("PowaListFrame"):IsVisible()) then |
||
426 | getglobal("PowaListFrame"):Hide(); |
||
427 | else |
||
428 | getglobal("PowaListFrame"):Show(); |
||
429 | getglobal("PowaHelpList"):SetText(PowaText.aideListe); |
||
430 | Powa_UpdateList(); |
||
431 | end |
||
432 | end |
||
433 | |||
434 | -- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
||
435 | |||
436 | function Powa_UpdateOptionsTimer() |
||
437 | |||
438 | if (PowaEnabled == 0) then return; end -- desactived |
||
439 | |||
440 | Powa_Timer[1]:SetAlpha(PowaMisc.BTimerA); |
||
441 | Powa_Timer[1]:SetWidth(20 * PowaMisc.BTimerScale); |
||
442 | Powa_Timer[1]:SetHeight(20 * PowaMisc.BTimerScale); |
||
443 | Powa_Timer[1]:SetPoint("Center", PowaMisc.BTimerX, PowaMisc.BTimerY); |
||
444 | |||
445 | Powa_Timer[2]:SetAlpha(PowaMisc.BTimerA); |
||
446 | Powa_Timer[2]:SetWidth(14 * PowaMisc.BTimerScale); |
||
447 | Powa_Timer[2]:SetHeight(14 * PowaMisc.BTimerScale); |
||
448 | Powa_Timer[2]:SetPoint("LEFT", Powa_Timer[1], "RIGHT", 1, -1.5); |
||
449 | Powa_Timer[2]:SetAlpha(PowaMisc.BTimerA * 0.75); |
||
450 | end |
||
451 | |||
452 | function Powa_UpdateOptions() |
||
453 | getglobal("PowaTimerAlphaSlider"):SetValue(PowaMisc.BTimerA); |
||
454 | getglobal("PowaTimerSizeSlider"):SetValue(PowaMisc.BTimerScale); |
||
455 | getglobal("PowaTimerCoordSlider"):SetValue(PowaMisc.BTimerY); |
||
456 | getglobal("PowaTimerCoordXSlider"):SetValue(PowaMisc.BTimerX); |
||
457 | |||
458 | getglobal("PowaTimer2AlphaSlider"):SetValue(PowaMisc.DTimerA); |
||
459 | getglobal("PowaTimer2SizeSlider"):SetValue(PowaMisc.DTimerScale); |
||
460 | getglobal("PowaTimer2CoordSlider"):SetValue(PowaMisc.DTimerY); |
||
461 | getglobal("PowaTimer2CoordXSlider"):SetValue(PowaMisc.DTimerX); |
||
462 | |||
463 | getglobal("PowaBuffTimerCentsButton"):SetChecked(PowaMisc.BCents); |
||
464 | getglobal("PowaDebuffTimerCentsButton"):SetChecked(PowaMisc.DCents); |
||
465 | getglobal("PowaDisableButton"):SetChecked(PowaMisc.disabled); |
||
466 | getglobal("PowaMaxTexSlider"):SetValue(PowaGlobal.maxtextures); |
||
467 | end |
||
468 | |||
469 | function PowaTimerAlphaSliderChanged() |
||
470 | local SliderValue = getglobal("PowaTimerAlphaSlider"):GetValue(); |
||
471 | |||
472 | getglobal("PowaTimerAlphaSliderText"):SetText(PowaText.nomAlpha.." : "..format("%.2f", SliderValue) ); |
||
473 | |||
474 | PowaMisc.BTimerA = SliderValue; |
||
475 | Powa_UpdateOptionsTimer() |
||
476 | end |
||
477 | |||
478 | function PowaTimerSizeSliderChanged() |
||
479 | local SliderValue = getglobal("PowaTimerSizeSlider"):GetValue(); |
||
480 | |||
481 | getglobal("PowaTimerSizeSliderText"):SetText(PowaText.nomTaille.." : "..format("%.2f", SliderValue) ); |
||
482 | |||
483 | PowaMisc.BTimerScale = SliderValue; |
||
484 | Powa_UpdateOptionsTimer() |
||
485 | end |
||
486 | |||
487 | function PowaTimerCoordSliderChanged() |
||
488 | local SliderValue = getglobal("PowaTimerCoordSlider"):GetValue(); |
||
489 | |||
490 | getglobal("PowaTimerCoordSliderText"):SetText(PowaText.nomPos.." Y : "..SliderValue); |
||
491 | |||
492 | PowaMisc.BTimerY = SliderValue; |
||
493 | Powa_UpdateOptionsTimer() |
||
494 | end |
||
495 | |||
496 | function PowaTimerCoordXSliderChanged() |
||
497 | local SliderValue = getglobal("PowaTimerCoordXSlider"):GetValue(); |
||
498 | |||
499 | getglobal("PowaTimerCoordXSliderText"):SetText(PowaText.nomPos.." X : "..SliderValue); |
||
500 | |||
501 | PowaMisc.BTimerX = SliderValue; |
||
502 | Powa_UpdateOptionsTimer() |
||
503 | end |
||
504 | -- -------------------------------------------------- timer 2 |
||
505 | function Powa_UpdateOptionsTimer2() |
||
506 | |||
507 | if (PowaEnabled == 0) then return; end -- desactived |
||
508 | |||
509 | Powa_Timer[3]:SetAlpha(PowaMisc.DTimerA); |
||
510 | Powa_Timer[3]:SetWidth(20 * PowaMisc.DTimerScale); |
||
511 | Powa_Timer[3]:SetHeight(20 * PowaMisc.DTimerScale); |
||
512 | Powa_Timer[3]:SetPoint("Center", PowaMisc.DTimerX, PowaMisc.DTimerY); |
||
513 | |||
514 | Powa_Timer[4]:SetAlpha(PowaMisc.DTimerA); |
||
515 | Powa_Timer[4]:SetWidth(14 * PowaMisc.DTimerScale); |
||
516 | Powa_Timer[4]:SetHeight(14 * PowaMisc.DTimerScale); |
||
517 | Powa_Timer[4]:SetPoint("LEFT", Powa_Timer[3], "RIGHT", 1, -1.5); |
||
518 | Powa_Timer[4]:SetAlpha(PowaMisc.DTimerA * 0.75); |
||
519 | end |
||
520 | |||
521 | function PowaTimer2AlphaSliderChanged() |
||
522 | local SliderValue = getglobal("PowaTimer2AlphaSlider"):GetValue(); |
||
523 | |||
524 | getglobal("PowaTimer2AlphaSliderText"):SetText(PowaText.nomAlpha.." : "..format("%.2f", SliderValue) ); |
||
525 | |||
526 | PowaMisc.DTimerA = SliderValue; |
||
527 | Powa_UpdateOptionsTimer2() |
||
528 | end |
||
529 | |||
530 | function PowaTimer2SizeSliderChanged() |
||
531 | local SliderValue = getglobal("PowaTimer2SizeSlider"):GetValue(); |
||
532 | |||
533 | getglobal("PowaTimer2SizeSliderText"):SetText(PowaText.nomTaille.." : "..format("%.2f", SliderValue) ); |
||
534 | |||
535 | PowaMisc.DTimerScale = SliderValue; |
||
536 | Powa_UpdateOptionsTimer2() |
||
537 | end |
||
538 | |||
539 | function PowaTimer2CoordSliderChanged() |
||
540 | local SliderValue = getglobal("PowaTimer2CoordSlider"):GetValue(); |
||
541 | |||
542 | getglobal("PowaTimer2CoordSliderText"):SetText(PowaText.nomPos.." Y : "..SliderValue); |
||
543 | |||
544 | PowaMisc.DTimerY = SliderValue; |
||
545 | Powa_UpdateOptionsTimer2() |
||
546 | end |
||
547 | |||
548 | function PowaTimer2CoordXSliderChanged() |
||
549 | local SliderValue = getglobal("PowaTimer2CoordXSlider"):GetValue(); |
||
550 | |||
551 | getglobal("PowaTimer2CoordXSliderText"):SetText(PowaText.nomPos.." X : "..SliderValue); |
||
552 | |||
553 | PowaMisc.DTimerX = SliderValue; |
||
554 | Powa_UpdateOptionsTimer2() |
||
555 | end |
||
556 | |||
557 | function PowaBuffTimerCentsChecked() |
||
558 | if (getglobal("PowaBuffTimerCentsButton"):GetChecked()) then |
||
559 | PowaMisc.BCents = true; |
||
560 | else |
||
561 | PowaMisc.BCents = false; |
||
562 | end |
||
563 | end |
||
564 | |||
565 | function PowaDebuffTimerCentsChecked() |
||
566 | if (getglobal("PowaDebuffTimerCentsButton"):GetChecked()) then |
||
567 | PowaMisc.DCents = true; |
||
568 | else |
||
569 | PowaMisc.DCents = false; |
||
570 | end |
||
571 | end |
||
572 | |||
573 | function PowaDisableChecked() |
||
574 | if (getglobal("PowaDisableButton"):GetChecked()) then |
||
575 | PowaMisc.disabled = true; |
||
576 | else |
||
577 | PowaMisc.disabled = false; |
||
578 | end |
||
579 | end |