vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 local HealBot_Options_ComboButtons_Button=1;
2  
3 function HealBot_Options_AddDebug(msg)
4 HealBot_AddDebug("Options: " .. msg);
5 end
6  
7 function HealBot_Options_Pct_OnLoad(this,text)
8 this.text = text;
9 getglobal(this:GetName().."Text"):SetText(text);
10 getglobal(this:GetName().."Low"):SetText("0%");
11 getglobal(this:GetName().."High"):SetText("100%");
12 this:SetMinMaxValues(0.00,1.00);
13 this:SetValueStep(0.01);
14 end
15  
16 function HealBot_Options_Pct_OnLoad_MinMax(this,text,Min,Max)
17 this.text = text;
18 local MinTxt,MaxTxt
19  
20 MinTxt=(Min*100).."%";
21 MaxTxt=(Max*100).."%";
22  
23 getglobal(this:GetName().."Text"):SetText(text);
24 getglobal(this:GetName().."Low"):SetText(MinTxt);
25 getglobal(this:GetName().."High"):SetText(MaxTxt);
26 this:SetMinMaxValues(Min,Max);
27 this:SetValueStep(0.01);
28 end
29  
30 function HealBot_Options_val_OnLoad(this,text,Min,Max)
31 this.text = text;
32  
33 getglobal(this:GetName().."Text"):SetText(text);
34 getglobal(this:GetName().."Low"):SetText(Min);
35 getglobal(this:GetName().."High"):SetText(Max);
36 this:SetMinMaxValues(Min,Max);
37 this:SetValueStep(1);
38 end
39  
40 function HealBot_Options_Pct_OnValueChanged(this)
41 local pct = math.floor(this:GetValue()*100+0.5);
42 getglobal(this:GetName().."Text"):SetText(this.text .. " (" .. pct .. "%)");
43 return this:GetValue();
44 end
45  
46  
47 function HealBot_Options_NewSkin_OnTextChanged(this)
48 local text= this:GetText()
49 if string.len(text)>0 then
50 HealBot_Options_NewSkinb:Enable();
51 else
52 HealBot_Options_NewSkinb:Disable();
53 end
54 end
55  
56 function HealBot_Options_NewSkinb_OnClick(this)
57 HealBot_Config.numcols[HealBot_Options_NewSkin:GetText()] = HealBot_Config.numcols[HealBot_Config.Current_Skin]
58 HealBot_Config.btexture[HealBot_Options_NewSkin:GetText()] = HealBot_Config.btexture[HealBot_Config.Current_Skin]
59 HealBot_Config.bcspace[HealBot_Options_NewSkin:GetText()] = HealBot_Config.bcspace[HealBot_Config.Current_Skin]
60 HealBot_Config.brspace[HealBot_Options_NewSkin:GetText()] = HealBot_Config.brspace[HealBot_Config.Current_Skin]
61 HealBot_Config.bwidth[HealBot_Options_NewSkin:GetText()] = HealBot_Config.bwidth[HealBot_Config.Current_Skin]
62 HealBot_Config.bheight[HealBot_Options_NewSkin:GetText()] = HealBot_Config.bheight[HealBot_Config.Current_Skin]
63 HealBot_Config.btextenabledcolr[HealBot_Options_NewSkin:GetText()] = HealBot_Config.btextenabledcolr[HealBot_Config.Current_Skin]
64 HealBot_Config.btextenabledcolg[HealBot_Options_NewSkin:GetText()] = HealBot_Config.btextenabledcolg[HealBot_Config.Current_Skin]
65 HealBot_Config.btextenabledcolb[HealBot_Options_NewSkin:GetText()] = HealBot_Config.btextenabledcolb[HealBot_Config.Current_Skin]
66 HealBot_Config.btextenabledcola[HealBot_Options_NewSkin:GetText()] = HealBot_Config.btextenabledcola[HealBot_Config.Current_Skin]
67 HealBot_Config.btextdisbledcolr[HealBot_Options_NewSkin:GetText()] = HealBot_Config.btextdisbledcolr[HealBot_Config.Current_Skin]
68 HealBot_Config.btextdisbledcolg[HealBot_Options_NewSkin:GetText()] = HealBot_Config.btextdisbledcolg[HealBot_Config.Current_Skin]
69 HealBot_Config.btextdisbledcolb[HealBot_Options_NewSkin:GetText()] = HealBot_Config.btextdisbledcolb[HealBot_Config.Current_Skin]
70 HealBot_Config.btextdisbledcola[HealBot_Options_NewSkin:GetText()] = HealBot_Config.btextdisbledcola[HealBot_Config.Current_Skin]
71 HealBot_Config.btextcursecolr[HealBot_Options_NewSkin:GetText()] = HealBot_Config.btextcursecolr[HealBot_Config.Current_Skin]
72 HealBot_Config.btextcursecolg[HealBot_Options_NewSkin:GetText()] = HealBot_Config.btextcursecolg[HealBot_Config.Current_Skin]
73 HealBot_Config.btextcursecolb[HealBot_Options_NewSkin:GetText()] = HealBot_Config.btextcursecolb[HealBot_Config.Current_Skin]
74 HealBot_Config.btextcursecola[HealBot_Options_NewSkin:GetText()] = HealBot_Config.btextcursecola[HealBot_Config.Current_Skin]
75 HealBot_Config.backcola[HealBot_Options_NewSkin:GetText()] = HealBot_Config.backcola[HealBot_Config.Current_Skin]
76 HealBot_Config.Barcola[HealBot_Options_NewSkin:GetText()] = HealBot_Config.Barcola[HealBot_Config.Current_Skin]
77 HealBot_Config.BarcolaInHeal[HealBot_Options_NewSkin:GetText()] = HealBot_Config.BarcolaInHeal[HealBot_Config.Current_Skin]
78 HealBot_Config.backcolr[HealBot_Options_NewSkin:GetText()] = HealBot_Config.backcolr[HealBot_Config.Current_Skin]
79 HealBot_Config.backcolg[HealBot_Options_NewSkin:GetText()] = HealBot_Config.backcolg[HealBot_Config.Current_Skin]
80 HealBot_Config.backcolb[HealBot_Options_NewSkin:GetText()] = HealBot_Config.backcolb[HealBot_Config.Current_Skin]
81 HealBot_Config.borcolr[HealBot_Options_NewSkin:GetText()] = HealBot_Config.borcolr[HealBot_Config.Current_Skin]
82 HealBot_Config.borcolg[HealBot_Options_NewSkin:GetText()] = HealBot_Config.borcolg[HealBot_Config.Current_Skin]
83 HealBot_Config.borcolb[HealBot_Options_NewSkin:GetText()] = HealBot_Config.borcolb[HealBot_Config.Current_Skin]
84 HealBot_Config.borcola[HealBot_Options_NewSkin:GetText()] = HealBot_Config.borcola[HealBot_Config.Current_Skin]
85 HealBot_Config.btextheight[HealBot_Options_NewSkin:GetText()] = HealBot_Config.btextheight[HealBot_Config.Current_Skin]
86 HealBot_Config.bardisa[HealBot_Options_NewSkin:GetText()] = HealBot_Config.bardisa[HealBot_Config.Current_Skin]
87 HealBot_Config.abortsize[HealBot_Options_NewSkin:GetText()] = HealBot_Config.abortsize[HealBot_Config.Current_Skin]
88 HealBot_Config.babortcolr[HealBot_Options_NewSkin:GetText()] = HealBot_Config.babortcolr[HealBot_Config.Current_Skin]
89 HealBot_Config.babortcolg[HealBot_Options_NewSkin:GetText()] = HealBot_Config.babortcolg[HealBot_Config.Current_Skin]
90 HealBot_Config.babortcolb[HealBot_Options_NewSkin:GetText()] = HealBot_Config.babortcolb[HealBot_Config.Current_Skin]
91 HealBot_Config.babortcola[HealBot_Options_NewSkin:GetText()] = HealBot_Config.babortcola[HealBot_Config.Current_Skin]
92 HealBot_Config.ShowHeader[HealBot_Options_NewSkin:GetText()] = HealBot_Config.ShowHeader[HealBot_Config.Current_Skin]
93  
94 table.insert(HealBot_Skins,2,HealBot_Options_NewSkin:GetText())
95 HealBot_Config.Skin_ID = 2;
96 HealBot_Config.Skins = HealBot_Skins; HealBot_Config.Current_Skin = HealBot_Options_NewSkin:GetText();
97 HealBot_Options_SetSkins()
98 HealBot_Options_NewSkin:SetText("")
99 end
100  
101 function HealBot_Options_DeleteSkin_OnClick(this)
102 if HealBot_Config.Current_Skin~=HEALBOT_SKINS_STD then
103 HealBot_Config.numcols[HealBot_Options_SkinsText:GetText()] = nil
104 HealBot_Config.btexture[HealBot_Options_SkinsText:GetText()] = nil
105 HealBot_Config.bcspace[HealBot_Options_SkinsText:GetText()] = nil
106 HealBot_Config.brspace[HealBot_Options_SkinsText:GetText()] = nil
107 HealBot_Config.bwidth[HealBot_Options_SkinsText:GetText()] = nil
108 HealBot_Config.bheight[HealBot_Options_SkinsText:GetText()] = nil
109 HealBot_Config.btextenabledcolr[HealBot_Options_SkinsText:GetText()] = nil
110 HealBot_Config.btextenabledcolg[HealBot_Options_SkinsText:GetText()] = nil
111 HealBot_Config.btextenabledcolb[HealBot_Options_SkinsText:GetText()] = nil
112 HealBot_Config.btextenabledcola[HealBot_Options_SkinsText:GetText()] = nil
113 HealBot_Config.btextdisbledcolr[HealBot_Options_SkinsText:GetText()] = nil
114 HealBot_Config.btextdisbledcolg[HealBot_Options_SkinsText:GetText()] = nil
115 HealBot_Config.btextdisbledcolb[HealBot_Options_SkinsText:GetText()] = nil
116 HealBot_Config.btextdisbledcola[HealBot_Options_SkinsText:GetText()] = nil
117 HealBot_Config.btextcursecolr[HealBot_Options_SkinsText:GetText()] = nil
118 HealBot_Config.btextcursecolg[HealBot_Options_SkinsText:GetText()] = nil
119 HealBot_Config.btextcursecolb[HealBot_Options_SkinsText:GetText()] = nil
120 HealBot_Config.btextcursecola[HealBot_Options_SkinsText:GetText()] = nil
121 HealBot_Config.backcola[HealBot_Options_SkinsText:GetText()] = nil
122 HealBot_Config.Barcola[HealBot_Options_SkinsText:GetText()] = nil
123 HealBot_Config.BarcolaInHeal[HealBot_Options_SkinsText:GetText()] = nil
124 HealBot_Config.backcolr[HealBot_Options_SkinsText:GetText()] = nil
125 HealBot_Config.backcolg[HealBot_Options_SkinsText:GetText()] = nil
126 HealBot_Config.backcolb[HealBot_Options_SkinsText:GetText()] = nil
127 HealBot_Config.borcolr[HealBot_Options_SkinsText:GetText()] = nil
128 HealBot_Config.borcolg[HealBot_Options_SkinsText:GetText()] = nil
129 HealBot_Config.borcolb[HealBot_Options_SkinsText:GetText()] = nil
130 HealBot_Config.borcola[HealBot_Options_SkinsText:GetText()] = nil
131 HealBot_Config.btextheight[HealBot_Options_SkinsText:GetText()] = nil
132 HealBot_Config.bardisa[HealBot_Options_SkinsText:GetText()] = nil
133 HealBot_Config.abortsize[HealBot_Options_SkinsText:GetText()] = nil
134 HealBot_Config.babortcolr[HealBot_Options_SkinsText:GetText()] = nil
135 HealBot_Config.babortcolg[HealBot_Options_SkinsText:GetText()] = nil
136 HealBot_Config.babortcolb[HealBot_Options_SkinsText:GetText()] = nil
137 HealBot_Config.babortcola[HealBot_Options_SkinsText:GetText()] = nil
138 HealBot_Config.ShowHeader[HealBot_Options_SkinsText:GetText()] = nil
139 table.remove(HealBot_Skins,HealBot_Config.Skin_ID)
140 HealBot_Config.Skin_ID = 1;
141 HealBot_Config.Skins = HealBot_Skins;
142 HealBot_Config.Current_Skin = HEALBOT_SKINS_STD;
143 HealBot_Options_SetSkins()
144 end
145 end
146  
147 function HealBot_Options_ShowHeaders_OnLoad(this)
148 getglobal(this:GetName().."Text"):SetText(HEALBOT_OPTIONS_SHOWHEADERS);
149 end
150  
151 function HealBot_Options_ShowHeaders_OnClick(this)
152 HealBot_Config.ShowHeader[HealBot_Config.Current_Skin] = this:GetChecked();
153 HealBot_Action_ResetSkin()
154 end
155  
156 function HealBot_Options_BarTextureS_OnValueChanged(this)
157 HealBot_Config.btexture[HealBot_Config.Current_Skin] = this:GetValue();
158 getglobal(this:GetName().."Text"):SetText(this.text .. ": " .. this:GetValue());
159 HealBot_Action_ResetSkin()
160 end
161  
162 function HealBot_Options_BarHeightS_OnValueChanged(this)
163 HealBot_Config.bheight[HealBot_Config.Current_Skin] = this:GetValue();
164 getglobal(this:GetName().."Text"):SetText(this.text .. ": " .. this:GetValue());
165 HealBot_Action_ResetSkin()
166 end
167  
168 function HealBot_Options_BarWidthS_OnValueChanged(this)
169 HealBot_Config.bwidth[HealBot_Config.Current_Skin] = this:GetValue();
170 getglobal(this:GetName().."Text"):SetText(this.text .. ": " .. this:GetValue());
171 HealBot_Action_ResetSkin()
172 end
173  
174 function HealBot_Options_BarNumColsS_OnValueChanged(this)
175 HealBot_Config.numcols[HealBot_Config.Current_Skin] = this:GetValue();
176 getglobal(this:GetName().."Text"):SetText(this.text .. ": " .. this:GetValue());
177 HealBot_Action_ResetSkin()
178 end
179  
180 function HealBot_Options_BarBRSpaceS_OnValueChanged(this)
181 HealBot_Config.brspace[HealBot_Config.Current_Skin] = this:GetValue();
182 getglobal(this:GetName().."Text"):SetText(this.text .. ": " .. this:GetValue());
183 HealBot_Action_ResetSkin()
184 end
185  
186 function HealBot_Options_BarBCSpaceS_OnValueChanged(this)
187 HealBot_Config.bcspace[HealBot_Config.Current_Skin] = this:GetValue();
188 getglobal(this:GetName().."Text"):SetText(this.text .. ": " .. this:GetValue());
189 HealBot_Action_ResetSkin()
190 end
191  
192 function HealBot_Options_FontHeight_OnValueChanged(this)
193 HealBot_Config.btextheight[HealBot_Config.Current_Skin] = this:GetValue();
194 getglobal(this:GetName().."Text"):SetText(this.text .. ": " .. this:GetValue());
195 HealBot_Action_ResetSkin()
196 end
197  
198 function HealBot_Options_AbortBarSize_OnValueChanged(this)
199 HealBot_Config.abortsize[HealBot_Config.Current_Skin] = this:GetValue();
200 getglobal(this:GetName().."Text"):SetText(this.text .. ": " .. this:GetValue());
201 HealBot_Action_ResetSkin()
202 end
203  
204 function HealBot_Options_ActionAlpha_OnValueChanged(this)
205 HealBot_Config.backcola[HealBot_Config.Current_Skin] = HealBot_Options_Pct_OnValueChanged(this);
206 end
207  
208 function HealBot_Options_BarAlpha_OnValueChanged(this)
209 HealBot_Config.Barcola[HealBot_Config.Current_Skin] = HealBot_Options_Pct_OnValueChanged(this);
210 HealBot_Action_ResetSkin()
211 end
212  
213 function HealBot_Options_BarAlphaInHeal_OnValueChanged(this)
214 HealBot_Config.BarcolaInHeal[HealBot_Config.Current_Skin] = HealBot_Options_Pct_OnValueChanged(this);
215 HealBot_Action_ResetSkin()
216 end
217  
218 function HealBot_Options_BarAlphaDis_OnValueChanged(this)
219 HealBot_Config.bardisa[HealBot_Config.Current_Skin] = HealBot_Options_Pct_OnValueChanged(this);
220 HealBot_Action_ResetSkin()
221 end
222  
223 local HealBot_ColourObjWaiting
224 function HealBot_SkinColorpick_OnClick(SkinType)
225 HealBot_ColourObjWaiting=SkinType;
226  
227 if SkinType=="En" then
228 HealBot_UseColourPick(HealBot_Config.btextenabledcolr[HealBot_Config.Current_Skin],
229 HealBot_Config.btextenabledcolg[HealBot_Config.Current_Skin],
230 HealBot_Config.btextenabledcolb[HealBot_Config.Current_Skin],
231 HealBot_Config.btextenabledcola[HealBot_Config.Current_Skin]);
232 elseif SkinType=="Dis" then
233 HealBot_UseColourPick(HealBot_Config.btextdisbledcolr[HealBot_Config.Current_Skin],
234 HealBot_Config.btextdisbledcolg[HealBot_Config.Current_Skin],
235 HealBot_Config.btextdisbledcolb[HealBot_Config.Current_Skin],
236 HealBot_Config.btextdisbledcola[HealBot_Config.Current_Skin])
237 elseif SkinType=="Debuff" then
238 HealBot_UseColourPick(HealBot_Config.btextcursecolr[HealBot_Config.Current_Skin],
239 HealBot_Config.btextcursecolg[HealBot_Config.Current_Skin],
240 HealBot_Config.btextcursecolb[HealBot_Config.Current_Skin],
241 HealBot_Config.btextcursecola[HealBot_Config.Current_Skin])
242 elseif SkinType=="Back" then
243 HealBot_UseColourPick(HealBot_Config.backcolr[HealBot_Config.Current_Skin],
244 HealBot_Config.backcolg[HealBot_Config.Current_Skin],
245 HealBot_Config.backcolb[HealBot_Config.Current_Skin],
246 HealBot_Config.backcola[HealBot_Config.Current_Skin])
247 elseif SkinType=="Bor" then
248 HealBot_UseColourPick(HealBot_Config.borcolr[HealBot_Config.Current_Skin],
249 HealBot_Config.borcolg[HealBot_Config.Current_Skin],
250 HealBot_Config.borcolb[HealBot_Config.Current_Skin],
251 HealBot_Config.borcola[HealBot_Config.Current_Skin])
252 elseif SkinType=="Abort" then
253 HealBot_UseColourPick(HealBot_Config.babortcolr[HealBot_Config.Current_Skin],
254 HealBot_Config.babortcolg[HealBot_Config.Current_Skin],
255 HealBot_Config.babortcolb[HealBot_Config.Current_Skin],
256 HealBot_Config.babortcola[HealBot_Config.Current_Skin])
257 end
258 end
259  
260 function HealBot_SetSkinColours()
261 local btextheight=HealBot_Config.btextheight[HealBot_Config.Current_Skin] or 10;
262  
263 HealBot_EnTextColorpick:SetStatusBarColor(0,1,0,HealBot_Config.Barcola[HealBot_Config.Current_Skin]);
264 HealBot_EnTextColorpickin:SetStatusBarColor(0,1,0,HealBot_Config.Barcola[HealBot_Config.Current_Skin]*HealBot_Config.BarcolaInHeal[HealBot_Config.Current_Skin]);
265 HealBot_DisTextColorpick:SetStatusBarColor(0,1,0,HealBot_Config.bardisa[HealBot_Config.Current_Skin]);
266 HealBot_EnTextColorpickt:SetTextColor(
267 HealBot_Config.btextenabledcolr[HealBot_Config.Current_Skin],
268 HealBot_Config.btextenabledcolg[HealBot_Config.Current_Skin],
269 HealBot_Config.btextenabledcolb[HealBot_Config.Current_Skin],
270 HealBot_Config.btextenabledcola[HealBot_Config.Current_Skin]);
271 HealBot_DisTextColorpickt:SetTextColor(
272 HealBot_Config.btextdisbledcolr[HealBot_Config.Current_Skin],
273 HealBot_Config.btextdisbledcolg[HealBot_Config.Current_Skin],
274 HealBot_Config.btextdisbledcolb[HealBot_Config.Current_Skin],
275 HealBot_Config.btextdisbledcola[HealBot_Config.Current_Skin]);
276 HealBot_DebTextColorpickt:SetTextColor(
277 HealBot_Config.btextcursecolr[HealBot_Config.Current_Skin],
278 HealBot_Config.btextcursecolg[HealBot_Config.Current_Skin],
279 HealBot_Config.btextcursecolb[HealBot_Config.Current_Skin],
280 HealBot_Config.btextcursecola[HealBot_Config.Current_Skin]);
281 HealBot_BackgroundColorpick:SetStatusBarColor(
282 HealBot_Config.backcolr[HealBot_Config.Current_Skin],
283 HealBot_Config.backcolg[HealBot_Config.Current_Skin],
284 HealBot_Config.backcolb[HealBot_Config.Current_Skin],
285 HealBot_Config.backcola[HealBot_Config.Current_Skin]);
286 HealBot_BorderColorpick:SetStatusBarColor(
287 HealBot_Config.borcolr[HealBot_Config.Current_Skin],
288 HealBot_Config.borcolg[HealBot_Config.Current_Skin],
289 HealBot_Config.borcolb[HealBot_Config.Current_Skin],
290 HealBot_Config.borcola[HealBot_Config.Current_Skin]);
291 HealBot_AbortColorpick:SetStatusBarColor(
292 HealBot_Config.babortcolr[HealBot_Config.Current_Skin],
293 HealBot_Config.babortcolg[HealBot_Config.Current_Skin],
294 HealBot_Config.babortcolb[HealBot_Config.Current_Skin],
295 HealBot_Config.babortcola[HealBot_Config.Current_Skin]);
296  
297 HealBot_Action:SetBackdropColor(
298 HealBot_Config.backcolr[HealBot_Config.Current_Skin],
299 HealBot_Config.backcolg[HealBot_Config.Current_Skin],
300 HealBot_Config.backcolb[HealBot_Config.Current_Skin],
301 HealBot_Config.backcola[HealBot_Config.Current_Skin]);
302 HealBot_Action:SetBackdropBorderColor(
303 HealBot_Config.borcolr[HealBot_Config.Current_Skin],
304 HealBot_Config.borcolg[HealBot_Config.Current_Skin],
305 HealBot_Config.borcolb[HealBot_Config.Current_Skin],
306 HealBot_Config.borcola[HealBot_Config.Current_Skin]);
307  
308 HealBot_EnTextColorpickt:SetTextHeight(btextheight);
309 HealBot_DisTextColorpickt:SetTextHeight(btextheight);
310 HealBot_DebTextColorpickt:SetTextHeight(btextheight);
311 HealBot_EnTextColorpickt:SetText(HEALBOT_SKIN_ENTEXT);
312 HealBot_DisTextColorpickt:SetText(HEALBOT_SKIN_DISTEXT);
313 HealBot_DebTextColorpickt:SetText(HEALBOT_SKIN_DEBTEXT);
314 local barScale = HealBot_EnTextColorpick:GetScale();
315 HealBot_EnTextColorpick:SetScale(barScale + 0.01);
316 HealBot_EnTextColorpick:SetScale(barScale);
317 HealBot_DisTextColorpick:SetScale(barScale + 0.01);
318 HealBot_DisTextColorpick:SetScale(barScale);
319 HealBot_DebTextColorpick:SetScale(barScale + 0.01);
320 HealBot_DebTextColorpick:SetScale(barScale);
321  
322 HealBot_Action_PartyChanged()
323 end
324  
325 function HealBot_Options_AlertLevel_OnValueChanged(this)
326 HealBot_Config.AlertLevel = HealBot_Options_Pct_OnValueChanged(this);
327 HealBot_Action_Refresh();
328 end
329  
330  
331 function HealBot_Options_AutoShow_OnLoad(this)
332 getglobal(this:GetName().."Text"):SetText(HEALBOT_OPTIONS_AUTOSHOW);
333 end
334  
335 function HealBot_Options_AutoShow_OnClick(this)
336 HealBot_Config.AutoClose = this:GetChecked() or 0;
337 HealBot_Action_Refresh();
338 end
339  
340  
341 function HealBot_Options_PanelSounds_OnLoad(this)
342 getglobal(this:GetName().."Text"):SetText(HEALBOT_OPTIONS_PANELSOUNDS);
343 end
344  
345 function HealBot_Options_PanelSounds_OnClick(this)
346 HealBot_Config.PanelSounds = this:GetChecked() or 0;
347 end
348  
349  
350 function HealBot_Options_ActionLocked_OnLoad(this)
351 getglobal(this:GetName().."Text"):SetText(HEALBOT_OPTIONS_ACTIONLOCKED);
352 end
353  
354 function HealBot_Options_ActionLocked_OnClick(this)
355 HealBot_Config.ActionLocked = this:GetChecked() or 0;
356 end
357  
358  
359 function HealBot_Options_GroupHeals_OnLoad(this,text)
360 this.text = text
361 getglobal(this:GetName().."Text"):SetText(this.text);
362 end
363  
364  
365 function HealBot_Options_GroupHeals_OnClick(this)
366 HealBot_Config.GroupHeals = this:GetChecked() or 0;
367 HealBot_RecalcParty();
368 end
369  
370  
371 function HealBot_Options_TankHeals_OnLoad(this,text)
372 this.text = text
373 getglobal(this:GetName().."Text"):SetText(this.text);
374 end
375  
376 function HealBot_Options_TankHeals_OnClick(this)
377 HealBot_Config.TankHeals = this:GetChecked() or 0;
378 HealBot_RecalcParty();
379 end
380  
381  
382 function HealBot_Options_TargetHeals_OnLoad(this,text)
383 this.text = text
384 getglobal(this:GetName().."Text"):SetText(this.text);
385 end
386  
387 function HealBot_Options_TargetHeals_OnClick(this)
388 HealBot_Config.TargetHeals = this:GetChecked() or 0;
389 HealBot_RecalcParty();
390 end
391  
392  
393 function HealBot_Options_EmergencyHeals_OnLoad(this,text)
394 this.text = text
395 getglobal(this:GetName().."Text"):SetText(this.text);
396 end
397  
398 function HealBot_Options_EmergencyHeals_OnClick(this)
399 HealBot_Config.EmergencyHeals = this:GetChecked() or 0;
400 HealBot_RecalcParty();
401 end
402  
403 function HealBot_Options_OverHeal_OnValueChanged(this)
404 HealBot_Config.OverHeal = HealBot_Options_Pct_OnValueChanged(this);
405 end
406  
407 function HealBot_Options_EFClass_OnLoad(this,text)
408 getglobal(this:GetName().."Text"):SetText(text);
409 end
410  
411 function HealBot_Options_EFClass_OnClick(this)
412 if HealBot_Config.EmergencyFClass==1 then
413 HealBot_Config.EmergIncMelee[HEALBOT_DRUID] = HealBot_Options_EFClassDruid:GetChecked() or 0;
414 HealBot_Config.EmergIncMelee[HEALBOT_HUNTER] = HealBot_Options_EFClassHunter:GetChecked() or 0;
415 HealBot_Config.EmergIncMelee[HEALBOT_MAGE] = HealBot_Options_EFClassMage:GetChecked() or 0;
416 HealBot_Config.EmergIncMelee[HEALBOT_PALADIN] = HealBot_Options_EFClassPaladin:GetChecked() or 0;
417 HealBot_Config.EmergIncMelee[HEALBOT_PRIEST] = HealBot_Options_EFClassPriest:GetChecked() or 0;
418 HealBot_Config.EmergIncMelee[HEALBOT_ROGUE] = HealBot_Options_EFClassRogue:GetChecked() or 0;
419 HealBot_Config.EmergIncMelee[HEALBOT_SHAMAN] = HealBot_Options_EFClassShaman:GetChecked() or 0;
420 HealBot_Config.EmergIncMelee[HEALBOT_WARLOCK] = HealBot_Options_EFClassWarlock:GetChecked() or 0;
421 HealBot_Config.EmergIncMelee[HEALBOT_WARRIOR] = HealBot_Options_EFClassWarrior:GetChecked() or 0;
422 elseif HealBot_Config.EmergencyFClass==2 then
423 HealBot_Config.EmergIncRange[HEALBOT_DRUID] = HealBot_Options_EFClassDruid:GetChecked() or 0;
424 HealBot_Config.EmergIncRange[HEALBOT_HUNTER] = HealBot_Options_EFClassHunter:GetChecked() or 0;
425 HealBot_Config.EmergIncRange[HEALBOT_MAGE] = HealBot_Options_EFClassMage:GetChecked() or 0;
426 HealBot_Config.EmergIncRange[HEALBOT_PALADIN] = HealBot_Options_EFClassPaladin:GetChecked() or 0;
427 HealBot_Config.EmergIncRange[HEALBOT_PRIEST] = HealBot_Options_EFClassPriest:GetChecked() or 0;
428 HealBot_Config.EmergIncRange[HEALBOT_ROGUE] = HealBot_Options_EFClassRogue:GetChecked() or 0;
429 HealBot_Config.EmergIncRange[HEALBOT_SHAMAN] = HealBot_Options_EFClassShaman:GetChecked() or 0;
430 HealBot_Config.EmergIncRange[HEALBOT_WARLOCK] = HealBot_Options_EFClassWarlock:GetChecked() or 0;
431 HealBot_Config.EmergIncRange[HEALBOT_WARRIOR] = HealBot_Options_EFClassWarrior:GetChecked() or 0;
432 elseif HealBot_Config.EmergencyFClass==3 then
433 HealBot_Config.EmergIncHealers[HEALBOT_DRUID] = HealBot_Options_EFClassDruid:GetChecked() or 0;
434 HealBot_Config.EmergIncHealers[HEALBOT_HUNTER] = HealBot_Options_EFClassHunter:GetChecked() or 0;
435 HealBot_Config.EmergIncHealers[HEALBOT_MAGE] = HealBot_Options_EFClassMage:GetChecked() or 0;
436 HealBot_Config.EmergIncHealers[HEALBOT_PALADIN] = HealBot_Options_EFClassPaladin:GetChecked() or 0;
437 HealBot_Config.EmergIncHealers[HEALBOT_PRIEST] = HealBot_Options_EFClassPriest:GetChecked() or 0;
438 HealBot_Config.EmergIncHealers[HEALBOT_ROGUE] = HealBot_Options_EFClassRogue:GetChecked() or 0;
439 HealBot_Config.EmergIncHealers[HEALBOT_SHAMAN] = HealBot_Options_EFClassShaman:GetChecked() or 0;
440 HealBot_Config.EmergIncHealers[HEALBOT_WARLOCK] = HealBot_Options_EFClassWarlock:GetChecked() or 0;
441 HealBot_Config.EmergIncHealers[HEALBOT_WARRIOR] = HealBot_Options_EFClassWarrior:GetChecked() or 0;
442 elseif HealBot_Config.EmergencyFClass==4 then
443 HealBot_Config.EmergIncCustom[HEALBOT_DRUID] = HealBot_Options_EFClassDruid:GetChecked() or 0;
444 HealBot_Config.EmergIncCustom[HEALBOT_HUNTER] = HealBot_Options_EFClassHunter:GetChecked() or 0;
445 HealBot_Config.EmergIncCustom[HEALBOT_MAGE] = HealBot_Options_EFClassMage:GetChecked() or 0;
446 HealBot_Config.EmergIncCustom[HEALBOT_PALADIN] = HealBot_Options_EFClassPaladin:GetChecked() or 0;
447 HealBot_Config.EmergIncCustom[HEALBOT_PRIEST] = HealBot_Options_EFClassPriest:GetChecked() or 0;
448 HealBot_Config.EmergIncCustom[HEALBOT_ROGUE] = HealBot_Options_EFClassRogue:GetChecked() or 0;
449 HealBot_Config.EmergIncCustom[HEALBOT_SHAMAN] = HealBot_Options_EFClassShaman:GetChecked() or 0;
450 HealBot_Config.EmergIncCustom[HEALBOT_WARLOCK] = HealBot_Options_EFClassWarlock:GetChecked() or 0;
451 HealBot_Config.EmergIncCustom[HEALBOT_WARRIOR] = HealBot_Options_EFClassWarrior:GetChecked() or 0;
452 end
453 if HealBot_Config.EmergIncMonitor>10 then
454 HealBot_Action_PartyChanged();
455 end
456 end
457  
458  
459 function HealBot_Options_CastNotify_OnLoad(this,text)
460 getglobal(this:GetName().."Text"):SetText(text);
461 end
462  
463 function HealBot_Options_CastNotify_OnClick(this,id)
464 if HealBot_Config.CastNotify>0 then
465 getglobal("HealBot_Options_CastNotify"..HealBot_Config.CastNotify):SetChecked(nil);
466 end
467 HealBot_Config.CastNotify = id;
468 if HealBot_Config.CastNotify>0 then
469 getglobal("HealBot_Options_CastNotify"..HealBot_Config.CastNotify):SetChecked(1);
470 end
471 end
472  
473 function HealBot_ComboButtons_Button_OnLoad(this,text)
474 getglobal(this:GetName().."Text"):SetText(text);
475 end
476  
477 function HealBot_ComboButtons_Button_OnClick(this,id)
478 if HealBot_Options_ComboButtons_Button>0 then
479 getglobal("HealBot_ComboButtons_Button"..HealBot_Options_ComboButtons_Button):SetChecked(nil);
480 end
481 HealBot_Options_ComboButtons_Button = id;
482 if HealBot_Options_ComboButtons_Button>0 then
483 getglobal("HealBot_ComboButtons_Button"..HealBot_Options_ComboButtons_Button):SetChecked(1);
484 end
485 HealBot_Options_ComboClass_Text()
486 end
487  
488 function HealBot_Options_HideOptions_OnLoad(this,text)
489 getglobal(this:GetName().."Text"):SetText(text);
490 end
491  
492 function HealBot_Options_HideOptions_OnClick(this)
493 HealBot_Config.HideOptions = this:GetChecked() or 0;
494 HealBot_Action_PartyChanged();
495 end
496  
497 function HealBot_Options_HideAbort_OnLoad(this,text)
498 getglobal(this:GetName().."Text"):SetText(text);
499 end
500  
501 function HealBot_Options_HideAbort_OnClick(this)
502 HealBot_Config.HideAbort = this:GetChecked() or 0;
503 HealBot_Action_PartyChanged();
504 end
505  
506 function HealBot_Options_ShowTooltip_OnLoad(this,text)
507 getglobal(this:GetName().."Text"):SetText(text);
508 end
509  
510 function HealBot_Options_ShowTooltip_OnClick(this)
511 HealBot_Config.ShowTooltip = this:GetChecked() or 0;
512 end
513  
514 function HealBot_Options_ShowTooltipTarget_OnLoad(this,text)
515 getglobal(this:GetName().."Text"):SetText(text);
516 end
517  
518 function HealBot_Options_ShowTooltipTarget_OnClick(this)
519 HealBot_Config.Tooltip_ShowTarget = this:GetChecked() or 0;
520 end
521  
522 function HealBot_Options_ShowTooltipSpellDetail_OnLoad(this,text)
523 getglobal(this:GetName().."Text"):SetText(text);
524 end
525  
526 function HealBot_Options_ShowTooltipSpellDetail_OnClick(this)
527 HealBot_Config.Tooltip_ShowSpellDetail = this:GetChecked() or 0;
528 end
529  
530 function HealBot_Options_ShowTooltipInstant_OnLoad(this,text)
531 getglobal(this:GetName().."Text"):SetText(text);
532 end
533  
534 function HealBot_Options_ShowTooltipInstant_OnClick(this)
535 HealBot_Config.Tooltip_Recommend = this:GetChecked() or 0;
536 end
537  
538 function HealBot_Options_ShowDebuffWarning_OnLoad(this,text)
539 getglobal(this:GetName().."Text"):SetText(text);
540 end
541  
542 function HealBot_Options_ShowDebuffWarning_OnClick(this)
543 HealBot_Config.ShowDebuffWarning = this:GetChecked() or 0;
544 end
545  
546 function HealBot_Options_SoundDebuffWarning_OnLoad(this,text)
547 getglobal(this:GetName().."Text"):SetText(text);
548 end
549  
550 function HealBot_Options_SoundDebuffWarning_OnClick(this)
551 HealBot_Config.SoundDebuffWarning = this:GetChecked() or 0;
552 if HealBot_Config.SoundDebuffWarning==0 then
553 HealBot_WarningSound1:Disable();
554 HealBot_WarningSound2:Disable();
555 HealBot_WarningSound3:Disable();
556 else
557 HealBot_WarningSound1:Enable();
558 HealBot_WarningSound2:Enable();
559 HealBot_WarningSound3:Enable();
560 end
561 end
562  
563 function HealBot_WarningSound_OnLoad(this,text)
564 getglobal(this:GetName().."Text"):SetText(text);
565 end
566  
567 function HealBot_WarningSound_OnClick(this,id)
568 if HealBot_Config.SoundDebuffPlay>0 then
569 getglobal("HealBot_WarningSound"..HealBot_Config.SoundDebuffPlay):SetChecked(nil);
570 end
571 HealBot_Config.SoundDebuffPlay = id;
572 if HealBot_Config.SoundDebuffPlay>0 then
573 getglobal("HealBot_WarningSound"..HealBot_Config.SoundDebuffPlay):SetChecked(1);
574 if this then
575 HealBot_PlaySound(HealBot_Config.SoundDebuffPlay)
576 end
577 end
578 end
579  
580  
581 function HealBot_Options_GrowUpwards_OnLoad(this,text)
582 getglobal(this:GetName().."Text"):SetText(text);
583 end
584  
585 function HealBot_Options_GrowUpwards_OnClick(this)
586 HealBot_Config.GrowUpwards = this:GetChecked() or 0;
587 HealBot_Action_PartyChanged();
588 end
589  
590  
591 function HealBot_Options_QualityRange_OnLoad(this,text)
592 getglobal(this:GetName().."Text"):SetText(text);
593 end
594  
595 function HealBot_Options_QualityRange_OnClick(this)
596 HealBot_Config.QualityRange = this:GetChecked() or 0;
597 HealBot_Action_PartyChanged();
598 end
599  
600 function HealBot_Options_ProtectPvP_OnLoad(this,text)
601 getglobal(this:GetName().."Text"):SetText(text);
602 end
603  
604 function HealBot_Options_ProtectPvP_OnClick(this)
605 HealBot_Config.ProtectPvP = this:GetChecked() or 0;
606 HealBot_Action_Refresh();
607 end
608  
609 --------------------------------------------------------------------------------
610  
611  
612 --------------------------------------------------------------------------------
613  
614 local HealBot_Options_EmergencyFClass_List = {
615 HEALBOT_CLASSES_MELEE,
616 HEALBOT_CLASSES_RANGES,
617 HEALBOT_CLASSES_HEALERS,
618 HEALBOT_CLASSES_CUSTOM,
619 }
620  
621 function HealBot_Options_EmergencyFClass_DropDown()
622 for i=1, getn(HealBot_Options_EmergencyFClass_List), 1 do
623 local info = {};
624 info.text = HealBot_Options_EmergencyFClass_List[i];
625 info.func = HealBot_Options_EmergencyFClass_OnSelect;
626 UIDropDownMenu_AddButton(info);
627 end
628 end
629  
630 function HealBot_Options_EmergencyFClass_Initialize()
631 UIDropDownMenu_Initialize(HealBot_Options_EmergencyFClass,HealBot_Options_EmergencyFClass_DropDown)
632 end
633  
634 function HealBot_Options_EmergencyFClass_Refresh(onselect)
635 if not HealBot_Config.EmergencyFClass then return end
636 if not onselect then HealBot_Options_EmergencyFClass_Initialize() end -- or wrong menu may be used !
637 UIDropDownMenu_SetSelectedID(HealBot_Options_EmergencyFClass,HealBot_Config.EmergencyFClass)
638 end
639  
640 function HealBot_Options_EmergencyFClass_OnLoad(this)
641 HealBot_Options_EmergencyFClass_Initialize()
642 UIDropDownMenu_SetWidth(100)
643 end
644  
645 function HealBot_Options_EmergencyFClass_OnSelect()
646 HealBot_Config.EmergencyFClass = this:GetID()
647 HealBot_Options_EmergencyFClass_Refresh(true)
648 HealBot_Options_EFClass_Reset()
649 end
650  
651 function HealBot_Options_EFClass_Reset()
652 if HealBot_Config.EmergencyFClass==1 then
653 HealBot_Options_EFClassDruid:SetChecked(HealBot_Config.EmergIncMelee[HEALBOT_DRUID]);
654 HealBot_Options_EFClassHunter:SetChecked(HealBot_Config.EmergIncMelee[HEALBOT_HUNTER]);
655 HealBot_Options_EFClassMage:SetChecked(HealBot_Config.EmergIncMelee[HEALBOT_MAGE]);
656 HealBot_Options_EFClassPaladin:SetChecked(HealBot_Config.EmergIncMelee[HEALBOT_PALADIN]);
657 HealBot_Options_EFClassPriest:SetChecked(HealBot_Config.EmergIncMelee[HEALBOT_PRIEST]);
658 HealBot_Options_EFClassRogue:SetChecked(HealBot_Config.EmergIncMelee[HEALBOT_ROGUE]);
659 HealBot_Options_EFClassShaman:SetChecked(HealBot_Config.EmergIncMelee[HEALBOT_SHAMAN]);
660 HealBot_Options_EFClassWarlock:SetChecked(HealBot_Config.EmergIncMelee[HEALBOT_WARLOCK]);
661 HealBot_Options_EFClassWarrior:SetChecked(HealBot_Config.EmergIncMelee[HEALBOT_WARRIOR]);
662 elseif HealBot_Config.EmergencyFClass==2 then
663 HealBot_Options_EFClassDruid:SetChecked(HealBot_Config.EmergIncRange[HEALBOT_DRUID]);
664 HealBot_Options_EFClassHunter:SetChecked(HealBot_Config.EmergIncRange[HEALBOT_HUNTER]);
665 HealBot_Options_EFClassMage:SetChecked(HealBot_Config.EmergIncRange[HEALBOT_MAGE]);
666 HealBot_Options_EFClassPaladin:SetChecked(HealBot_Config.EmergIncRange[HEALBOT_PALADIN]);
667 HealBot_Options_EFClassPriest:SetChecked(HealBot_Config.EmergIncRange[HEALBOT_PRIEST]);
668 HealBot_Options_EFClassRogue:SetChecked(HealBot_Config.EmergIncRange[HEALBOT_ROGUE]);
669 HealBot_Options_EFClassShaman:SetChecked(HealBot_Config.EmergIncRange[HEALBOT_SHAMAN]);
670 HealBot_Options_EFClassWarlock:SetChecked(HealBot_Config.EmergIncRange[HEALBOT_WARLOCK]);
671 HealBot_Options_EFClassWarrior:SetChecked(HealBot_Config.EmergIncRange[HEALBOT_WARRIOR]);
672 elseif HealBot_Config.EmergencyFClass==3 then
673 HealBot_Options_EFClassDruid:SetChecked(HealBot_Config.EmergIncHealers[HEALBOT_DRUID]);
674 HealBot_Options_EFClassHunter:SetChecked(HealBot_Config.EmergIncHealers[HEALBOT_HUNTER]);
675 HealBot_Options_EFClassMage:SetChecked(HealBot_Config.EmergIncHealers[HEALBOT_MAGE]);
676 HealBot_Options_EFClassPaladin:SetChecked(HealBot_Config.EmergIncHealers[HEALBOT_PALADIN]);
677 HealBot_Options_EFClassPriest:SetChecked(HealBot_Config.EmergIncHealers[HEALBOT_PRIEST]);
678 HealBot_Options_EFClassRogue:SetChecked(HealBot_Config.EmergIncHealers[HEALBOT_ROGUE]);
679 HealBot_Options_EFClassShaman:SetChecked(HealBot_Config.EmergIncHealers[HEALBOT_SHAMAN]);
680 HealBot_Options_EFClassWarlock:SetChecked(HealBot_Config.EmergIncHealers[HEALBOT_WARLOCK]);
681 HealBot_Options_EFClassWarrior:SetChecked(HealBot_Config.EmergIncHealers[HEALBOT_WARRIOR]);
682 elseif HealBot_Config.EmergencyFClass==4 then
683 HealBot_Options_EFClassDruid:SetChecked(HealBot_Config.EmergIncCustom[HEALBOT_DRUID]);
684 HealBot_Options_EFClassHunter:SetChecked(HealBot_Config.EmergIncCustom[HEALBOT_HUNTER]);
685 HealBot_Options_EFClassMage:SetChecked(HealBot_Config.EmergIncCustom[HEALBOT_MAGE]);
686 HealBot_Options_EFClassPaladin:SetChecked(HealBot_Config.EmergIncCustom[HEALBOT_PALADIN]);
687 HealBot_Options_EFClassPriest:SetChecked(HealBot_Config.EmergIncCustom[HEALBOT_PRIEST]);
688 HealBot_Options_EFClassRogue:SetChecked(HealBot_Config.EmergIncCustom[HEALBOT_ROGUE]);
689 HealBot_Options_EFClassShaman:SetChecked(HealBot_Config.EmergIncCustom[HEALBOT_SHAMAN]);
690 HealBot_Options_EFClassWarlock:SetChecked(HealBot_Config.EmergIncCustom[HEALBOT_WARLOCK]);
691 HealBot_Options_EFClassWarrior:SetChecked(HealBot_Config.EmergIncCustom[HEALBOT_WARRIOR]);
692 end
693 end
694  
695 --------------------------------------------------------------------------------
696  
697 local HealBot_Options_ExtraSort_List = {
698 HEALBOT_SORTBY_NAME,
699 HEALBOT_SORTBY_CLASS,
700 HEALBOT_SORTBY_GROUP,
701 HEALBOT_SORTBY_MAXHEALTH,
702 }
703  
704 function HealBot_Options_ExtraSort_DropDown()
705 for i=1, getn(HealBot_Options_ExtraSort_List), 1 do
706 local info = {};
707 info.text = HealBot_Options_ExtraSort_List[i];
708 info.func = HealBot_Options_ExtraSort_OnSelect;
709 UIDropDownMenu_AddButton(info);
710 end
711 end
712  
713 function HealBot_Options_ExtraSort_Initialize()
714 UIDropDownMenu_Initialize(HealBot_Options_ExtraSort,HealBot_Options_ExtraSort_DropDown)
715 end
716  
717 function HealBot_Options_ExtraSort_Refresh(onselect)
718 if not HealBot_Config.ExtraOrder then return end
719 if not onselect then HealBot_Options_ExtraSort_Initialize() end -- or wrong menu may be used !
720 UIDropDownMenu_SetSelectedID(HealBot_Options_ExtraSort,HealBot_Config.ExtraOrder)
721 end
722  
723 function HealBot_Options_ExtraSort_OnLoad(this)
724 HealBot_Options_ExtraSort_Initialize()
725 UIDropDownMenu_SetWidth(100)
726 end
727  
728 function HealBot_Options_ExtraSort_OnSelect()
729 HealBot_Config.ExtraOrder = this:GetID()
730 HealBot_Options_ExtraSort_Refresh(true)
731 HealBot_Action_PartyChanged()
732 end
733  
734 --------------------------------------------------------------------------------
735  
736 local HealBot_Options_EmergencyFilter_List = {
737 HEALBOT_CLASSES_ALL,
738 HEALBOT_DRUID,
739 HEALBOT_HUNTER,
740 HEALBOT_MAGE,
741 HEALBOT_PALADIN,
742 HEALBOT_PRIEST,
743 HEALBOT_ROGUE,
744 HEALBOT_SHAMAN,
745 HEALBOT_WARLOCK,
746 HEALBOT_WARRIOR,
747 HEALBOT_CLASSES_MELEE,
748 HEALBOT_CLASSES_RANGES,
749 HEALBOT_CLASSES_HEALERS,
750 HEALBOT_CLASSES_CUSTOM,
751 }
752  
753 function HealBot_Options_EmergencyFilter_DropDown()
754 for i=1, getn(HealBot_Options_EmergencyFilter_List), 1 do
755 local info = {};
756 info.text = HealBot_Options_EmergencyFilter_List[i];
757 info.func = HealBot_Options_EmergencyFilter_OnSelect;
758 UIDropDownMenu_AddButton(info);
759 end
760 end
761  
762 function HealBot_Options_CDCMonitor_DropDown()
763 for i=1, getn(HealBot_Options_EmergencyFilter_List), 1 do
764 local info = {};
765 info.text = HealBot_Options_EmergencyFilter_List[i];
766 info.func = HealBot_Options_CDCMonitor_OnSelect;
767 UIDropDownMenu_AddButton(info);
768 end
769 end
770  
771 function HealBot_Options_EmergencyFilter_Initialize()
772 UIDropDownMenu_Initialize(HealBot_Options_EmergencyFilter,HealBot_Options_EmergencyFilter_DropDown)
773 end
774  
775 function HealBot_Options_CDCMonitor_Initialize()
776 UIDropDownMenu_Initialize(HealBot_Options_CDCMonitor,HealBot_Options_CDCMonitor_DropDown)
777 end
778  
779 function HealBot_Options_EmergencyFilter_Refresh(onselect)
780 if not HealBot_Config.EmergIncMonitor then return end
781 if not onselect then HealBot_Options_EmergencyFilter_Initialize() end -- or wrong menu may be used !
782 UIDropDownMenu_SetSelectedID(HealBot_Options_EmergencyFilter,HealBot_Config.EmergIncMonitor)
783 end
784  
785 function HealBot_Options_CDCMonitor_Refresh(onselect)
786 if not HealBot_Config.CDCMonitor then return end
787 if not onselect then HealBot_Options_CDCMonitor_Initialize() end -- or wrong menu may be used !
788 UIDropDownMenu_SetSelectedID(HealBot_Options_CDCMonitor,HealBot_Config.CDCMonitor)
789 end
790  
791 function HealBot_Options_EmergencyFilter_OnLoad(this)
792 HealBot_Options_EmergencyFilter_Initialize()
793 UIDropDownMenu_SetWidth(100)
794 end
795  
796 function HealBot_Options_CDCMonitor_OnLoad(this)
797 HealBot_Options_CDCMonitor_Initialize()
798 UIDropDownMenu_SetWidth(100)
799 end
800  
801 function HealBot_Options_EmergencyFilter_OnSelect()
802 HealBot_Config.EmergIncMonitor = this:GetID()
803 HealBot_Options_EmergencyFilter_Refresh(true)
804 HealBot_Options_EmergencyFilter_Reset()
805 end
806  
807 function HealBot_Options_EmergencyFilter_Reset()
808  
809 HealBot_EmergInc[HEALBOT_DRUID] = 0;
810 HealBot_EmergInc[HEALBOT_HUNTER] = 0;
811 HealBot_EmergInc[HEALBOT_MAGE] = 0;
812 HealBot_EmergInc[HEALBOT_PALADIN] = 0;
813 HealBot_EmergInc[HEALBOT_PRIEST] = 0;
814 HealBot_EmergInc[HEALBOT_ROGUE] = 0;
815 HealBot_EmergInc[HEALBOT_SHAMAN] = 0;
816 HealBot_EmergInc[HEALBOT_WARLOCK] = 0;
817 HealBot_EmergInc[HEALBOT_WARRIOR] = 0;
818 if HealBot_Config.EmergIncMonitor==1 then
819 HealBot_EmergInc[HEALBOT_DRUID] = 1;
820 HealBot_EmergInc[HEALBOT_HUNTER] = 1;
821 HealBot_EmergInc[HEALBOT_MAGE] = 1;
822 HealBot_EmergInc[HEALBOT_PALADIN] = 1;
823 HealBot_EmergInc[HEALBOT_PRIEST] = 1;
824 HealBot_EmergInc[HEALBOT_ROGUE] = 1;
825 HealBot_EmergInc[HEALBOT_SHAMAN] = 1;
826 HealBot_EmergInc[HEALBOT_WARLOCK] = 1;
827 HealBot_EmergInc[HEALBOT_WARRIOR] = 1;
828 elseif HealBot_Config.EmergIncMonitor==2 then
829 HealBot_EmergInc[HEALBOT_DRUID] = 1;
830 elseif HealBot_Config.EmergIncMonitor==3 then
831 HealBot_EmergInc[HEALBOT_HUNTER] = 1;
832 elseif HealBot_Config.EmergIncMonitor==4 then
833 HealBot_EmergInc[HEALBOT_MAGE] = 1;
834 elseif HealBot_Config.EmergIncMonitor==5 then
835 HealBot_EmergInc[HEALBOT_PALADIN] = 1;
836 elseif HealBot_Config.EmergIncMonitor==6 then
837 HealBot_EmergInc[HEALBOT_PRIEST] = 1;
838 elseif HealBot_Config.EmergIncMonitor==7 then
839 HealBot_EmergInc[HEALBOT_ROGUE] = 1;
840 elseif HealBot_Config.EmergIncMonitor==8 then
841 HealBot_EmergInc[HEALBOT_SHAMAN] = 1;
842 elseif HealBot_Config.EmergIncMonitor==9 then
843 HealBot_EmergInc[HEALBOT_WARLOCK] = 1;
844 elseif HealBot_Config.EmergIncMonitor==10 then
845 HealBot_EmergInc[HEALBOT_WARRIOR] = 1;
846 elseif HealBot_Config.EmergIncMonitor==11 then
847 HealBot_EmergInc[HEALBOT_DRUID] = HealBot_Config.EmergIncMelee[HEALBOT_DRUID];
848 HealBot_EmergInc[HEALBOT_HUNTER] = HealBot_Config.EmergIncMelee[HEALBOT_HUNTER];
849 HealBot_EmergInc[HEALBOT_MAGE] = HealBot_Config.EmergIncMelee[HEALBOT_MAGE];
850 HealBot_EmergInc[HEALBOT_PALADIN] = HealBot_Config.EmergIncMelee[HEALBOT_PALADIN];
851 HealBot_EmergInc[HEALBOT_PRIEST] = HealBot_Config.EmergIncMelee[HEALBOT_PRIEST];
852 HealBot_EmergInc[HEALBOT_ROGUE] = HealBot_Config.EmergIncMelee[HEALBOT_ROGUE];
853 HealBot_EmergInc[HEALBOT_SHAMAN] = HealBot_Config.EmergIncMelee[HEALBOT_SHAMAN];
854 HealBot_EmergInc[HEALBOT_WARLOCK] = HealBot_Config.EmergIncMelee[HEALBOT_WARLOCK];
855 HealBot_EmergInc[HEALBOT_WARRIOR] = HealBot_Config.EmergIncMelee[HEALBOT_WARRIOR];
856 elseif HealBot_Config.EmergIncMonitor==12 then
857 HealBot_EmergInc[HEALBOT_DRUID] = HealBot_Config.EmergIncRange[HEALBOT_DRUID];
858 HealBot_EmergInc[HEALBOT_HUNTER] = HealBot_Config.EmergIncRange[HEALBOT_HUNTER];
859 HealBot_EmergInc[HEALBOT_MAGE] = HealBot_Config.EmergIncRange[HEALBOT_MAGE];
860 HealBot_EmergInc[HEALBOT_PALADIN] = HealBot_Config.EmergIncRange[HEALBOT_PALADIN];
861 HealBot_EmergInc[HEALBOT_PRIEST] = HealBot_Config.EmergIncRange[HEALBOT_PRIEST];
862 HealBot_EmergInc[HEALBOT_ROGUE] = HealBot_Config.EmergIncRange[HEALBOT_ROGUE];
863 HealBot_EmergInc[HEALBOT_SHAMAN] = HealBot_Config.EmergIncRange[HEALBOT_SHAMAN];
864 HealBot_EmergInc[HEALBOT_WARLOCK] = HealBot_Config.EmergIncRange[HEALBOT_WARLOCK];
865 HealBot_EmergInc[HEALBOT_WARRIOR] = HealBot_Config.EmergIncRange[HEALBOT_WARRIOR];
866 elseif HealBot_Config.EmergIncMonitor==13 then
867 HealBot_EmergInc[HEALBOT_DRUID] = HealBot_Config.EmergIncHealers[HEALBOT_DRUID];
868 HealBot_EmergInc[HEALBOT_HUNTER] = HealBot_Config.EmergIncHealers[HEALBOT_HUNTER];
869 HealBot_EmergInc[HEALBOT_MAGE] = HealBot_Config.EmergIncHealers[HEALBOT_MAGE];
870 HealBot_EmergInc[HEALBOT_PALADIN] = HealBot_Config.EmergIncHealers[HEALBOT_PALADIN];
871 HealBot_EmergInc[HEALBOT_PRIEST] = HealBot_Config.EmergIncHealers[HEALBOT_PRIEST];
872 HealBot_EmergInc[HEALBOT_ROGUE] = HealBot_Config.EmergIncHealers[HEALBOT_ROGUE];
873 HealBot_EmergInc[HEALBOT_SHAMAN] = HealBot_Config.EmergIncHealers[HEALBOT_SHAMAN];
874 HealBot_EmergInc[HEALBOT_WARLOCK] = HealBot_Config.EmergIncHealers[HEALBOT_WARLOCK];
875 HealBot_EmergInc[HEALBOT_WARRIOR] = HealBot_Config.EmergIncHealers[HEALBOT_WARRIOR];
876 elseif HealBot_Config.EmergIncMonitor==14 then
877 HealBot_EmergInc[HEALBOT_DRUID] = HealBot_Config.EmergIncCustom[HEALBOT_DRUID];
878 HealBot_EmergInc[HEALBOT_HUNTER] = HealBot_Config.EmergIncCustom[HEALBOT_HUNTER];
879 HealBot_EmergInc[HEALBOT_MAGE] = HealBot_Config.EmergIncCustom[HEALBOT_MAGE];
880 HealBot_EmergInc[HEALBOT_PALADIN] = HealBot_Config.EmergIncCustom[HEALBOT_PALADIN];
881 HealBot_EmergInc[HEALBOT_PRIEST] = HealBot_Config.EmergIncCustom[HEALBOT_PRIEST];
882 HealBot_EmergInc[HEALBOT_ROGUE] = HealBot_Config.EmergIncCustom[HEALBOT_ROGUE];
883 HealBot_EmergInc[HEALBOT_SHAMAN] = HealBot_Config.EmergIncCustom[HEALBOT_SHAMAN];
884 HealBot_EmergInc[HEALBOT_WARLOCK] = HealBot_Config.EmergIncCustom[HEALBOT_WARLOCK];
885 HealBot_EmergInc[HEALBOT_WARRIOR] = HealBot_Config.EmergIncCustom[HEALBOT_WARRIOR];
886 end
887  
888 HealBot_Action_PartyChanged()
889 end
890  
891 function HealBot_Options_CDCMonitor_OnSelect()
892 HealBot_Config.CDCMonitor = this:GetID()
893 HealBot_Options_CDCMonitor_Refresh(true)
894 HealBot_Options_CDCMonitor_Reset()
895 end
896  
897 function HealBot_Options_CDCMonitor_Reset()
898  
899 HealBot_CDCInc[HEALBOT_DRUID] = 0;
900 HealBot_CDCInc[HEALBOT_HUNTER] = 0;
901 HealBot_CDCInc[HEALBOT_MAGE] = 0;
902 HealBot_CDCInc[HEALBOT_PALADIN] = 0;
903 HealBot_CDCInc[HEALBOT_PRIEST] = 0;
904 HealBot_CDCInc[HEALBOT_ROGUE] = 0;
905 HealBot_CDCInc[HEALBOT_SHAMAN] = 0;
906 HealBot_CDCInc[HEALBOT_WARLOCK] = 0;
907 HealBot_CDCInc[HEALBOT_WARRIOR] = 0;
908 if HealBot_Config.CDCMonitor==1 then
909 HealBot_CDCInc[HEALBOT_DRUID] = 1;
910 HealBot_CDCInc[HEALBOT_HUNTER] = 1;
911 HealBot_CDCInc[HEALBOT_MAGE] = 1;
912 HealBot_CDCInc[HEALBOT_PALADIN] = 1;
913 HealBot_CDCInc[HEALBOT_PRIEST] = 1;
914 HealBot_CDCInc[HEALBOT_ROGUE] = 1;
915 HealBot_CDCInc[HEALBOT_SHAMAN] = 1;
916 HealBot_CDCInc[HEALBOT_WARLOCK] = 1;
917 HealBot_CDCInc[HEALBOT_WARRIOR] = 1;
918 elseif HealBot_Config.CDCMonitor==2 then
919 HealBot_CDCInc[HEALBOT_DRUID] = 1;
920 elseif HealBot_Config.CDCMonitor==3 then
921 HealBot_CDCInc[HEALBOT_HUNTER] = 1;
922 elseif HealBot_Config.CDCMonitor==4 then
923 HealBot_CDCInc[HEALBOT_MAGE] = 1;
924 elseif HealBot_Config.CDCMonitor==5 then
925 HealBot_CDCInc[HEALBOT_PALADIN] = 1;
926 elseif HealBot_Config.CDCMonitor==6 then
927 HealBot_CDCInc[HEALBOT_PRIEST] = 1;
928 elseif HealBot_Config.CDCMonitor==7 then
929 HealBot_CDCInc[HEALBOT_ROGUE] = 1;
930 elseif HealBot_Config.CDCMonitor==8 then
931 HealBot_CDCInc[HEALBOT_SHAMAN] = 1;
932 elseif HealBot_Config.CDCMonitor==9 then
933 HealBot_CDCInc[HEALBOT_WARLOCK] = 1;
934 elseif HealBot_Config.CDCMonitor==10 then
935 HealBot_CDCInc[HEALBOT_WARRIOR] = 1;
936 elseif HealBot_Config.CDCMonitor==11 then
937 HealBot_CDCInc[HEALBOT_DRUID] = HealBot_Config.EmergIncMelee[HEALBOT_DRUID];
938 HealBot_CDCInc[HEALBOT_HUNTER] = HealBot_Config.EmergIncMelee[HEALBOT_HUNTER];
939 HealBot_CDCInc[HEALBOT_MAGE] = HealBot_Config.EmergIncMelee[HEALBOT_MAGE];
940 HealBot_CDCInc[HEALBOT_PALADIN] = HealBot_Config.EmergIncMelee[HEALBOT_PALADIN];
941 HealBot_CDCInc[HEALBOT_PRIEST] = HealBot_Config.EmergIncMelee[HEALBOT_PRIEST];
942 HealBot_CDCInc[HEALBOT_ROGUE] = HealBot_Config.EmergIncMelee[HEALBOT_ROGUE];
943 HealBot_CDCInc[HEALBOT_SHAMAN] = HealBot_Config.EmergIncMelee[HEALBOT_SHAMAN];
944 HealBot_CDCInc[HEALBOT_WARLOCK] = HealBot_Config.EmergIncMelee[HEALBOT_WARLOCK];
945 HealBot_CDCInc[HEALBOT_WARRIOR] = HealBot_Config.EmergIncMelee[HEALBOT_WARRIOR];
946 elseif HealBot_Config.CDCMonitor==12 then
947 HealBot_CDCInc[HEALBOT_DRUID] = HealBot_Config.EmergIncRange[HEALBOT_DRUID];
948 HealBot_CDCInc[HEALBOT_HUNTER] = HealBot_Config.EmergIncRange[HEALBOT_HUNTER];
949 HealBot_CDCInc[HEALBOT_MAGE] = HealBot_Config.EmergIncRange[HEALBOT_MAGE];
950 HealBot_CDCInc[HEALBOT_PALADIN] = HealBot_Config.EmergIncRange[HEALBOT_PALADIN];
951 HealBot_CDCInc[HEALBOT_PRIEST] = HealBot_Config.EmergIncRange[HEALBOT_PRIEST];
952 HealBot_CDCInc[HEALBOT_ROGUE] = HealBot_Config.EmergIncRange[HEALBOT_ROGUE];
953 HealBot_CDCInc[HEALBOT_SHAMAN] = HealBot_Config.EmergIncRange[HEALBOT_SHAMAN];
954 HealBot_CDCInc[HEALBOT_WARLOCK] = HealBot_Config.EmergIncRange[HEALBOT_WARLOCK];
955 HealBot_CDCInc[HEALBOT_WARRIOR] = HealBot_Config.EmergIncRange[HEALBOT_WARRIOR];
956 elseif HealBot_Config.CDCMonitor==13 then
957 HealBot_CDCInc[HEALBOT_DRUID] = HealBot_Config.EmergIncHealers[HEALBOT_DRUID];
958 HealBot_CDCInc[HEALBOT_HUNTER] = HealBot_Config.EmergIncHealers[HEALBOT_HUNTER];
959 HealBot_CDCInc[HEALBOT_MAGE] = HealBot_Config.EmergIncHealers[HEALBOT_MAGE];
960 HealBot_CDCInc[HEALBOT_PALADIN] = HealBot_Config.EmergIncHealers[HEALBOT_PALADIN];
961 HealBot_CDCInc[HEALBOT_PRIEST] = HealBot_Config.EmergIncHealers[HEALBOT_PRIEST];
962 HealBot_CDCInc[HEALBOT_ROGUE] = HealBot_Config.EmergIncHealers[HEALBOT_ROGUE];
963 HealBot_CDCInc[HEALBOT_SHAMAN] = HealBot_Config.EmergIncHealers[HEALBOT_SHAMAN];
964 HealBot_CDCInc[HEALBOT_WARLOCK] = HealBot_Config.EmergIncHealers[HEALBOT_WARLOCK];
965 HealBot_CDCInc[HEALBOT_WARRIOR] = HealBot_Config.EmergIncHealers[HEALBOT_WARRIOR];
966 elseif HealBot_Config.CDCMonitor==14 then
967 HealBot_CDCInc[HEALBOT_DRUID] = HealBot_Config.EmergIncCustom[HEALBOT_DRUID];
968 HealBot_CDCInc[HEALBOT_HUNTER] = HealBot_Config.EmergIncCustom[HEALBOT_HUNTER];
969 HealBot_CDCInc[HEALBOT_MAGE] = HealBot_Config.EmergIncCustom[HEALBOT_MAGE];
970 HealBot_CDCInc[HEALBOT_PALADIN] = HealBot_Config.EmergIncCustom[HEALBOT_PALADIN];
971 HealBot_CDCInc[HEALBOT_PRIEST] = HealBot_Config.EmergIncCustom[HEALBOT_PRIEST];
972 HealBot_CDCInc[HEALBOT_ROGUE] = HealBot_Config.EmergIncCustom[HEALBOT_ROGUE];
973 HealBot_CDCInc[HEALBOT_SHAMAN] = HealBot_Config.EmergIncCustom[HEALBOT_SHAMAN];
974 HealBot_CDCInc[HEALBOT_WARLOCK] = HealBot_Config.EmergIncCustom[HEALBOT_WARLOCK];
975 HealBot_CDCInc[HEALBOT_WARRIOR] = HealBot_Config.EmergIncCustom[HEALBOT_WARRIOR];
976 end
977  
978 HealBot_Action_PartyChanged()
979 end
980  
981 --------------------------------------------------------------------------------
982  
983 function HealBot_Options_Skins_DropDown()
984 for i=1, getn(HealBot_Skins), 1 do
985 local info = {};
986 info.text = HealBot_Skins[i];
987 info.func = HealBot_Options_Skins_OnSelect;
988 UIDropDownMenu_AddButton(info);
989 end
990 end
991  
992 function HealBot_Options_Skins_Initialize()
993 UIDropDownMenu_Initialize(HealBot_Options_Skins,HealBot_Options_Skins_DropDown)
994 end
995  
996 function HealBot_Options_Skins_Refresh(onselect)
997 if not HealBot_Config.Skin_ID then return end
998 if not onselect then HealBot_Options_Skins_Initialize() end -- or wrong menu may be used !
999 UIDropDownMenu_SetSelectedID(HealBot_Options_Skins,HealBot_Config.Skin_ID)
1000 end
1001  
1002 function HealBot_Options_Skins_OnLoad(this)
1003 HealBot_Options_Skins_Initialize()
1004 UIDropDownMenu_SetWidth(100)
1005 end
1006  
1007 function HealBot_Options_Skins_OnSelect()
1008 HealBot_Config.Skin_ID = this:GetID()
1009 HealBot_Options_Skins_Refresh(true)
1010 if this:GetID()>=1 then
1011 HealBot_Config.Current_Skin = this:GetText()
1012 HealBot_Options_SetSkins()
1013 end
1014 end
1015  
1016 --------------------------------------------------------------------------------
1017  
1018 local HealBot_Options_TooltipPos_List = {
1019 HEALBOT_TOOLTIP_POSDEFAULT,
1020 HEALBOT_TOOLTIP_POSLEFT,
1021 HEALBOT_TOOLTIP_POSRIGHT,
1022 HEALBOT_TOOLTIP_POSABOVE,
1023 HEALBOT_TOOLTIP_POSBELOW,
1024 }
1025  
1026 function HealBot_Options_TooltipPos_DropDown()
1027 for i=1, getn(HealBot_Options_TooltipPos_List), 1 do
1028 local info = {};
1029 info.text = HealBot_Options_TooltipPos_List[i];
1030 info.func = HealBot_Options_TooltipPos_OnSelect;
1031 UIDropDownMenu_AddButton(info);
1032 end
1033 end
1034  
1035 function HealBot_Options_TooltipPos_Initialize()
1036 UIDropDownMenu_Initialize(HealBot_Options_TooltipPos,HealBot_Options_TooltipPos_DropDown)
1037 end
1038  
1039 function HealBot_Options_TooltipPos_Refresh(onselect)
1040 if not HealBot_Config.TooltipPos then return end
1041 if not onselect then HealBot_Options_TooltipPos_Initialize() end -- or wrong menu may be used !
1042 UIDropDownMenu_SetSelectedID(HealBot_Options_TooltipPos,HealBot_Config.TooltipPos)
1043 end
1044  
1045 function HealBot_Options_TooltipPos_OnLoad(this)
1046 HealBot_Options_TooltipPos_Initialize()
1047 UIDropDownMenu_SetWidth(128)
1048 end
1049  
1050 function HealBot_Options_TooltipPos_OnSelect()
1051 HealBot_Config.TooltipPos = this:GetID()
1052 HealBot_Options_TooltipPos_Refresh(true)
1053 end
1054  
1055 --------------------------------------------------------------------------------
1056  
1057 local HealBot_Options_ComboClass_List = {
1058 HEALBOT_DRUID,
1059 HEALBOT_PALADIN,
1060 HEALBOT_PRIEST,
1061 HEALBOT_SHAMAN,
1062 }
1063  
1064 function HealBot_Options_GetDebuffSpells_List(class)
1065 local DebuffSpells = HealBot_Debuff_Spells[class];
1066 return DebuffSpells;
1067 end
1068  
1069 function HealBot_Options_CDCButLeft_DropDown()
1070 local classEN=HealBot_UnitClass("player")
1071 if classEN=="PRIEST" or classEN=="DRUID" or classEN=="PALADIN" or classEN=="SHAMAN" then
1072 local class=UnitClass("Player");
1073 local DebuffSpells_List = HealBot_Options_GetDebuffSpells_List(class)
1074 local info = {};
1075 info.text = "None";
1076 info.func = HealBot_Options_CDCButLeft_OnSelect;
1077 UIDropDownMenu_AddButton(info);
1078 for i=1, getn(DebuffSpells_List), 1 do
1079 local spell=HealBot_GetSpellName(HealBot_GetSpellId(DebuffSpells_List[i]));
1080 if spell then
1081 local info = {};
1082 info.text = spell;
1083 info.func = HealBot_Options_CDCButLeft_OnSelect;
1084 UIDropDownMenu_AddButton(info);
1085 end
1086 end
1087 end
1088 end
1089  
1090 function HealBot_Options_CDCButRight_DropDown()
1091 local classEN=HealBot_UnitClass("player")
1092 if classEN=="PRIEST" or classEN=="DRUID" or classEN=="PALADIN" or classEN=="SHAMAN" then
1093 local class=UnitClass("Player");
1094 local DebuffSpells_List = HealBot_Options_GetDebuffSpells_List(class)
1095 local info = {};
1096 info.text = "None";
1097 info.func = HealBot_Options_CDCButRight_OnSelect;
1098 UIDropDownMenu_AddButton(info);
1099 for i=1, getn(DebuffSpells_List), 1 do
1100 local spell=HealBot_GetSpellName(HealBot_GetSpellId(DebuffSpells_List[i]));
1101 if spell then
1102 local info = {};
1103 info.text = spell;
1104 info.func = HealBot_Options_CDCButRight_OnSelect;
1105 UIDropDownMenu_AddButton(info);
1106 end
1107 end
1108 end
1109 end
1110  
1111 function HealBot_Options_CDCButLeft_Initialize()
1112 UIDropDownMenu_Initialize(HealBot_Options_CDCButLeft,HealBot_Options_CDCButLeft_DropDown)
1113 end
1114  
1115 function HealBot_Options_CDCButRight_Initialize()
1116 UIDropDownMenu_Initialize(HealBot_Options_CDCButRight,HealBot_Options_CDCButRight_DropDown)
1117 end
1118  
1119 function HealBot_Options_CDCButLeft_Refresh(onselect)
1120 local set_id=1;
1121 local class=UnitClass("Player");
1122 if not onselect then HealBot_Options_CDCButLeft_Initialize() end
1123 set_id = HealBot_Config.Debuff_Left[class];
1124 UIDropDownMenu_SetSelectedID(HealBot_Options_CDCButLeft,set_id)
1125 end
1126  
1127 function HealBot_Options_CDCButRight_Refresh(onselect)
1128 local set_id;
1129 local class=UnitClass("Player");
1130 if not onselect then HealBot_Options_CDCButRight_Initialize() end
1131 set_id = HealBot_Config.Debuff_Right[class];
1132 UIDropDownMenu_SetSelectedID(HealBot_Options_CDCButRight,set_id)
1133 end
1134  
1135 function HealBot_Options_ComboClass_Text()
1136 local class=UnitClass("Player");
1137 local combo = HealBot_Config.KeyCombo[class]
1138 local button = HealBot_Options_ComboClass_Button()
1139 if combo then
1140 HealBot_Options_Click:SetText(combo[button] or "")
1141 HealBot_Options_Shift:SetText(combo["Shift"..button] or "")
1142 HealBot_Options_Ctrl:SetText(combo["Ctrl"..button] or "")
1143 HealBot_Options_ShiftCtrl:SetText(combo["ShiftCtrl"..button] or "")
1144 end
1145 end
1146  
1147 function HealBot_Options_CDCButLeft_OnLoad(this)
1148 HealBot_Options_CDCButLeft_Initialize()
1149 UIDropDownMenu_SetWidth(140)
1150 end
1151  
1152 function HealBot_Options_CDCButRight_OnLoad(this)
1153 HealBot_Options_CDCButRight_Initialize()
1154 UIDropDownMenu_SetWidth(140)
1155 end
1156  
1157 function HealBot_Options_CDCButLeft_OnSelect()
1158 local class=UnitClass("Player");
1159 HealBot_Config.Debuff_Left[class] = this:GetID();
1160 HealBot_Options_CDCButLeft_Refresh(true)
1161 HealBot_Config.CDCLeftText[class]=HealBot_Options_CDCButLeftText:GetText();
1162 if this:GetID()>1 then
1163 HealBot_Options_CDC_SetCombo(HealBot_Options_CDCButLeftText:GetText(), "Left", class)
1164 end
1165 HealBot_DebuffPriority = HealBot_Debuff_Types[HealBot_Options_CDCButLeftText:GetText()];
1166 HealBot_Options_Debuff_Reset()
1167 end
1168  
1169 function HealBot_Options_CDCButRight_OnSelect()
1170 local class=UnitClass("Player");
1171 HealBot_Config.Debuff_Right[class] = this:GetID();
1172 HealBot_Options_CDCButRight_Refresh(true)
1173 HealBot_Config.CDCRightText[class]=HealBot_Options_CDCButRightText:GetText();
1174 if this:GetID()>1 then
1175 HealBot_Options_CDC_SetCombo(HealBot_Options_CDCButRightText:GetText(), "Right", class)
1176 end
1177 HealBot_Options_Debuff_Reset()
1178 end
1179  
1180 function HealBot_Options_CDC_SetCombo(spell, button, class)
1181 local combo = HealBot_Config.KeyCombo[class]
1182 combo["Alt"..button] = spell
1183 HealBot_Options_KeyCombo_Change()
1184 end
1185  
1186 function HealBot_Options_ComboClass_Button()
1187 local button = "Left"
1188 if HealBot_Options_ComboButtons_Button==2 then button = "Middle"; end
1189 if HealBot_Options_ComboButtons_Button==3 then button = "Right"; end
1190 if HealBot_Options_ComboButtons_Button==4 then button = "Button4"; end
1191 if HealBot_Options_ComboButtons_Button==5 then button = "Button5"; end
1192 return button;
1193 end
1194  
1195  
1196 function HealBot_Options_Debuff_Reset()
1197 local classEN=HealBot_UnitClass("player")
1198 if classEN=="PRIEST" or classEN=="DRUID" or classEN=="PALADIN" or classEN=="SHAMAN" then
1199 local spell = HealBot_Config.CDCLeftText[UnitClass("player")];
1200 HealBot_DebuffWatch = {[HEALBOT_DISEASE_en]="NO", [HEALBOT_MAGIC_en]="NO", [HEALBOT_POISON_en]="NO", [HEALBOT_CURSE_en]="NO" }
1201 if spell ~= "None" then
1202 table.foreach(HealBot_Debuff_Types[spell], function (index,debuff)
1203 HealBot_DebuffWatch[debuff]="YES";
1204 end)
1205 end
1206 spell = HealBot_Config.CDCRightText[UnitClass("player")];
1207 if spell ~= "None" then
1208 table.foreach(HealBot_Debuff_Types[spell], function (index,debuff)
1209 HealBot_DebuffWatch[debuff]="YES";
1210 end)
1211 end
1212 end
1213 end
1214  
1215 function HealBot_Colorpick_OnClick(CDCType)
1216 HealBot_ColourObjWaiting=CDCType;
1217 HealBot_UseColourPick(HealBot_Config.CDCBarColour[CDCType].R,HealBot_Config.CDCBarColour[CDCType].G,HealBot_Config.CDCBarColour[CDCType].B, nil)
1218 end
1219  
1220 function HealBot_Returned_Colours()
1221 local A = OpacitySliderFrame:GetValue();
1222 A = ((0-A)+1);
1223 if HealBot_ColourObjWaiting=="En" then
1224 HealBot_Config.btextenabledcolr[HealBot_Config.Current_Skin],
1225 HealBot_Config.btextenabledcolg[HealBot_Config.Current_Skin],
1226 HealBot_Config.btextenabledcolb[HealBot_Config.Current_Skin] = ColorPickerFrame:GetColorRGB();
1227 HealBot_Config.btextenabledcola[HealBot_Config.Current_Skin] = A;
1228 elseif HealBot_ColourObjWaiting=="Dis" then
1229 HealBot_Config.btextdisbledcolr[HealBot_Config.Current_Skin],
1230 HealBot_Config.btextdisbledcolg[HealBot_Config.Current_Skin],
1231 HealBot_Config.btextdisbledcolb[HealBot_Config.Current_Skin] = ColorPickerFrame:GetColorRGB();
1232 HealBot_Config.btextdisbledcola[HealBot_Config.Current_Skin] = A;
1233 elseif HealBot_ColourObjWaiting=="Debuff" then
1234 HealBot_Config.btextcursecolr[HealBot_Config.Current_Skin],
1235 HealBot_Config.btextcursecolg[HealBot_Config.Current_Skin],
1236 HealBot_Config.btextcursecolb[HealBot_Config.Current_Skin] = ColorPickerFrame:GetColorRGB();
1237 HealBot_Config.btextcursecola[HealBot_Config.Current_Skin] = A;
1238 elseif HealBot_ColourObjWaiting=="Back" then
1239 HealBot_Config.backcolr[HealBot_Config.Current_Skin],
1240 HealBot_Config.backcolg[HealBot_Config.Current_Skin],
1241 HealBot_Config.backcolb[HealBot_Config.Current_Skin] = ColorPickerFrame:GetColorRGB();
1242 HealBot_Config.backcola[HealBot_Config.Current_Skin] = A;
1243 elseif HealBot_ColourObjWaiting=="Bor" then
1244 HealBot_Config.borcolr[HealBot_Config.Current_Skin],
1245 HealBot_Config.borcolg[HealBot_Config.Current_Skin],
1246 HealBot_Config.borcolb[HealBot_Config.Current_Skin] = ColorPickerFrame:GetColorRGB();
1247 HealBot_Config.borcola[HealBot_Config.Current_Skin] = A;
1248 elseif HealBot_ColourObjWaiting=="Abort" then
1249 HealBot_Config.babortcolr[HealBot_Config.Current_Skin],
1250 HealBot_Config.babortcolg[HealBot_Config.Current_Skin],
1251 HealBot_Config.babortcolb[HealBot_Config.Current_Skin] = ColorPickerFrame:GetColorRGB();
1252 HealBot_Config.babortcola[HealBot_Config.Current_Skin] = A;
1253 else
1254 HealBot_Config.CDCBarColour[HealBot_ColourObjWaiting].R,
1255 HealBot_Config.CDCBarColour[HealBot_ColourObjWaiting].G,
1256 HealBot_Config.CDCBarColour[HealBot_ColourObjWaiting].B = ColorPickerFrame:GetColorRGB();
1257 end
1258 HealBot_SetSkinColours()
1259 HealBot_SetCDCBarColours()
1260 end
1261 ColorPickerFrame.func = HealBot_Returned_Colours
1262  
1263 function HealBot_UseColourPick(R, G, B, A)
1264 if ColorPickerFrame:IsVisible() then
1265 ColorPickerFrame:Hide();
1266 elseif A then
1267 ColorPickerFrame.hasOpacity = true;
1268 ColorPickerFrame.opacity = A;
1269 ColorPickerFrame:ClearAllPoints();
1270 ColorPickerFrame:SetPoint("TOPLEFT","HealBot_Options","TOPRIGHT",0,-152);
1271 ColorPickerFrame:Show();
1272 OpacitySliderFrame:SetValue(1-A);
1273 ColorPickerFrame:SetColorRGB(R, G, B);
1274 else
1275 ColorPickerFrame.hasOpacity = false;
1276 ColorPickerFrame:ClearAllPoints();
1277 ColorPickerFrame:SetPoint("TOPLEFT","HealBot_Options","TOPRIGHT",0,-152);
1278 ColorPickerFrame:Show();
1279 ColorPickerFrame:SetColorRGB(R, G, B);
1280 end
1281 return ColorPickerFrame:GetColorRGB();
1282 end
1283  
1284  
1285  
1286 function HealBot_SetCDCBarColours()
1287 HealBot_DiseaseColorpick:SetStatusBarColor(HealBot_Config.CDCBarColour[HEALBOT_DISEASE_en].R,
1288 HealBot_Config.CDCBarColour[HEALBOT_DISEASE_en].G,
1289 HealBot_Config.CDCBarColour[HEALBOT_DISEASE_en].B,
1290 HealBot_Config.Barcola[HealBot_Config.Current_Skin]);
1291 HealBot_MagicColorpick:SetStatusBarColor(HealBot_Config.CDCBarColour[HEALBOT_MAGIC_en].R,
1292 HealBot_Config.CDCBarColour[HEALBOT_MAGIC_en].G,
1293 HealBot_Config.CDCBarColour[HEALBOT_MAGIC_en].B,
1294 HealBot_Config.Barcola[HealBot_Config.Current_Skin]);
1295 HealBot_PoisonColorpick:SetStatusBarColor(HealBot_Config.CDCBarColour[HEALBOT_POISON_en].R,
1296 HealBot_Config.CDCBarColour[HEALBOT_POISON_en].G,
1297 HealBot_Config.CDCBarColour[HEALBOT_POISON_en].B,
1298 HealBot_Config.Barcola[HealBot_Config.Current_Skin]);
1299 HealBot_CurseColorpick:SetStatusBarColor(HealBot_Config.CDCBarColour[HEALBOT_CURSE_en].R,
1300 HealBot_Config.CDCBarColour[HEALBOT_CURSE_en].G,
1301 HealBot_Config.CDCBarColour[HEALBOT_CURSE_en].B,
1302 HealBot_Config.Barcola[HealBot_Config.Current_Skin]);
1303 HealBot_DebTextColorpick:SetStatusBarColor(HealBot_Config.CDCBarColour[HEALBOT_DISEASE_en].R,
1304 HealBot_Config.CDCBarColour[HEALBOT_DISEASE_en].G,
1305 HealBot_Config.CDCBarColour[HEALBOT_DISEASE_en].B,
1306 HealBot_Config.Barcola[HealBot_Config.Current_Skin])
1307 end
1308  
1309 --------------------------------------------------------------------------------
1310  
1311 function HealBot_Options_EditBox_OnLoad(this,text)
1312 getglobal(this:GetName().."Text"):SetText(text);
1313 end
1314  
1315 function HealBot_Options_Click_OnTextChanged(this)
1316 local class=UnitClass("Player");
1317 local combo = HealBot_Config.KeyCombo[class]
1318 local button = HealBot_Options_ComboClass_Button()
1319 combo[button] = this:GetText()
1320 HealBot_Options_KeyCombo_Change()
1321 end
1322  
1323 function HealBot_Options_Shift_OnTextChanged(this)
1324 local class=UnitClass("Player");
1325 local combo = HealBot_Config.KeyCombo[class]
1326 local button = HealBot_Options_ComboClass_Button()
1327 combo["Shift"..button] = this:GetText()
1328 HealBot_Options_KeyCombo_Change()
1329 end
1330  
1331 function HealBot_Options_Ctrl_OnTextChanged(this)
1332 local class=UnitClass("Player");
1333 local combo = HealBot_Config.KeyCombo[class]
1334 local button = HealBot_Options_ComboClass_Button()
1335 combo["Ctrl"..button] = this:GetText()
1336 HealBot_Options_KeyCombo_Change()
1337 end
1338  
1339 function HealBot_Options_ShiftCtrl_OnTextChanged(this)
1340 local class=UnitClass("Player");
1341 local combo = HealBot_Config.KeyCombo[class]
1342 local button = HealBot_Options_ComboClass_Button()
1343 combo["ShiftCtrl"..button] = this:GetText()
1344 HealBot_Options_KeyCombo_Change()
1345 end
1346  
1347 function HealBot_Options_KeyCombo_Change()
1348 local class=UnitClass("Player");
1349 HealBot_Config.KeyCombo[class]=HealBot_Config.KeyCombo[class];
1350  
1351 end
1352  
1353 function HealBot_Options_EnableHealthy_OnLoad(this,text)
1354 getglobal(this:GetName().."Text"):SetText(text);
1355 end
1356  
1357 function HealBot_Options_EnableHealthy_OnClick(this)
1358 HealBot_Config.EnableHealthy = this:GetChecked() or 0;
1359 HealBot_Action_EnableButtons();
1360 end
1361  
1362 --------------------------------------------------------------------------------
1363  
1364 function HealBot_Options_Defaults_OnClick(this)
1365 HealBot_Options_CastNotify_OnClick(nil,0);
1366 -- HealBot_Config = HealBot_ConfigDefaults;
1367 table.foreach(HealBot_ConfigDefaults, function (key,val)
1368 HealBot_Config[key] = val;
1369 end);
1370 HealBot_Options_OnShow(HealBot_Options);
1371 HealBot_RecalcSpells();
1372 HealBot_Action_Reset();
1373 HealBot_Config.ActionVisible = HealBot_Action:IsVisible();
1374 end
1375  
1376 function HealBot_Options_OnLoad(this)
1377 table.insert(UISpecialFrames,this:GetName());
1378  
1379 -- Tabs
1380 PanelTemplates_SetNumTabs(this,5);
1381 this.selectedTab = 1;
1382 PanelTemplates_UpdateTabs(this);
1383 HealBot_Options_ShowPanel(this.selectedTab);
1384 end
1385  
1386 function HealBot_Options_OnShow(this)
1387 HealBot_Skins = HealBot_Config.Skins;
1388 HealBot_Options_SetSkins()
1389 HealBot_Options_ActionLocked:SetChecked(HealBot_Config.ActionLocked);
1390 HealBot_Options_AlertLevel:SetValue(HealBot_Config.AlertLevel);
1391 HealBot_Options_AutoShow:SetChecked(HealBot_Config.AutoClose);
1392 HealBot_Options_PanelSounds:SetChecked(HealBot_Config.PanelSounds);
1393 HealBot_Options_GroupHeals:SetChecked(HealBot_Config.GroupHeals);
1394 if CT_RA_MainTanks then
1395 HealBot_Options_TankHeals:SetChecked(HealBot_Config.TankHeals);
1396 else
1397 HealBot_Options_TankHeals:Disable();
1398 HealBot_Options_TankHealsText:SetTextColor(0.6,0.6,0.6,0.75);
1399 end
1400 HealBot_Options_TargetHeals:SetChecked(HealBot_Config.TargetHeals);
1401 HealBot_Options_EmergencyHeals:SetChecked(HealBot_Config.EmergencyHeals);
1402 HealBot_Options_OverHeal:SetValue(HealBot_Config.OverHeal);
1403 HealBot_Options_CastNotify_OnClick(nil,HealBot_Config.CastNotify);
1404 HealBot_Options_HideOptions:SetChecked(HealBot_Config.HideOptions);
1405 HealBot_Options_ShowTooltip:SetChecked(HealBot_Config.ShowTooltip);
1406 HealBot_Options_GrowUpwards:SetChecked(HealBot_Config.GrowUpwards);
1407 HealBot_Options_QualityRange:SetChecked(HealBot_Config.QualityRange);
1408 HealBot_Options_ProtectPvP:SetChecked(HealBot_Config.ProtectPvP);
1409 HealBot_Options_SoundDebuffWarning:SetChecked(HealBot_Config.SoundDebuffWarning);
1410 HealBot_Options_ShowTooltipTarget:SetChecked(HealBot_Config.Tooltip_ShowTarget);
1411 HealBot_Options_ShowTooltipSpellDetail:SetChecked(HealBot_Config.Tooltip_ShowSpellDetail);
1412 HealBot_Options_ShowTooltipInstant:SetChecked(HealBot_Config.Tooltip_Recommend);
1413 HealBot_Options_HideAbort:SetChecked(HealBot_Config.HideAbort);
1414 HealBot_WarningSound_OnClick(nil,HealBot_Config.SoundDebuffPlay)
1415 if HealBot_Config.SoundDebuffWarning>0 then
1416 HealBot_WarningSound1:Enable();
1417 HealBot_WarningSound2:Enable();
1418 HealBot_WarningSound3:Enable();
1419 else
1420 HealBot_WarningSound1:Disable();
1421 HealBot_WarningSound2:Disable();
1422 HealBot_WarningSound3:Disable();
1423 end
1424 HealBot_Options_ShowDebuffWarning:SetChecked(HealBot_Config.ShowDebuffWarning);
1425 HealBot_Options_EmergencyFilter_Refresh()
1426 HealBot_Options_EmergencyFClass_Refresh();
1427 HealBot_Options_EFClass_Reset();
1428 HealBot_Options_CDCButLeft_Refresh()
1429 HealBot_Options_CDCButRight_Refresh()
1430 HealBot_SetCDCBarColours()
1431 HealBot_Options_CDCMonitor_Refresh()
1432 HealBot_ComboButtons_Button_OnClick(nil,HealBot_Options_ComboButtons_Button);
1433 HealBot_Options_EnableHealthy:SetChecked(HealBot_Config.EnableHealthy);
1434 HealBot_Options_NewSkinb:Disable();
1435 HealBot_Options_ExtraSort_Refresh();
1436 HealBot_Options_TooltipPos_Refresh();
1437 end
1438  
1439 function HealBot_Options_SetSkins()
1440 HealBot_Options_Skins_Refresh()
1441 HealBot_Options_BarAlpha:SetValue(HealBot_Config.Barcola[HealBot_Config.Current_Skin]);
1442 HealBot_Options_BarAlphaInHeal:SetValue(HealBot_Config.BarcolaInHeal[HealBot_Config.Current_Skin]);
1443 HealBot_Options_BarTextureS:SetValue(HealBot_Config.btexture[HealBot_Config.Current_Skin])
1444 HealBot_Options_BarHeightS:SetValue(HealBot_Config.bheight[HealBot_Config.Current_Skin])
1445 HealBot_Options_BarWidthS:SetValue(HealBot_Config.bwidth[HealBot_Config.Current_Skin])
1446 HealBot_Options_BarNumColsS:SetValue(HealBot_Config.numcols[HealBot_Config.Current_Skin])
1447 HealBot_Options_BarBRSpaceS:SetValue(HealBot_Config.brspace[HealBot_Config.Current_Skin])
1448 HealBot_Options_BarBCSpaceS:SetValue(HealBot_Config.bcspace[HealBot_Config.Current_Skin])
1449 HealBot_Options_FontHeight:SetValue(HealBot_Config.btextheight[HealBot_Config.Current_Skin])
1450 HealBot_Options_BarAlphaDis:SetValue(HealBot_Config.bardisa[HealBot_Config.Current_Skin])
1451 HealBot_Options_AbortBarSize:SetValue(HealBot_Config.abortsize[HealBot_Config.Current_Skin])
1452 HealBot_Options_ShowHeaders:SetChecked(HealBot_Config.ShowHeader[HealBot_Config.Current_Skin] or 0)
1453 HealBot_SetSkinColours()
1454 if HealBot_Config.Current_Skin==HEALBOT_SKINS_STD then
1455 HealBot_Options_DeleteSkin:Disable();
1456 else
1457 HealBot_Options_DeleteSkin:Enable();
1458 end
1459 end
1460  
1461 HealBot_Options_CurrentPanel = 0;
1462  
1463 function HealBot_Options_ShowPanel(id)
1464 if HealBot_Options_CurrentPanel>0 then
1465 getglobal("HealBot_Options_Panel"..HealBot_Options_CurrentPanel):Hide();
1466 end
1467 HealBot_Options_CurrentPanel = id;
1468 if HealBot_Options_CurrentPanel>0 then
1469 getglobal("HealBot_Options_Panel"..HealBot_Options_CurrentPanel):Show();
1470 end
1471 end