vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | function CCWatchOptions_Toggle() |
2 | if(CCWatchOptionsFrame:IsVisible()) then |
||
3 | CCWatchOptionsFrame:Hide(); |
||
4 | else |
||
5 | CCWatchOptionsFrame:Show(); |
||
6 | end |
||
7 | end |
||
8 | |||
9 | function CCWatchOptions_MageCCToggle() |
||
10 | local bState = not CCWATCH.MONITORMAGE; |
||
11 | CCWATCH.MONITORMAGE = bState; |
||
12 | CCWatch_Save[CCWATCH.PROFILE].MonitorMage = bState; |
||
13 | CCWATCH.CCS[CCWATCH_POLYMORPH].MONITOR = bState; |
||
14 | CCWATCH.CCS[CCWATCH_FROSTNOVA].MONITOR = bState; |
||
15 | CCWATCH.CCS[CCWATCH_FROSTBITE].MONITOR = bState; |
||
16 | CCWATCH.CCS[CCWATCH_ICEBLOCK].MONITOR = bState; |
||
17 | end |
||
18 | |||
19 | function CCWatchOptions_PriestCCToggle() |
||
20 | local bState = not CCWATCH.MONITORPRIEST; |
||
21 | CCWATCH.MONITORPRIEST = bState; |
||
22 | CCWatch_Save[CCWATCH.PROFILE].MonitorPriest = bState; |
||
23 | CCWATCH.CCS[CCWATCH_SHACKLE].MONITOR = bState; |
||
24 | CCWATCH.CCS[CCWATCH_PSYCHICSCREAM].MONITOR = bState; |
||
25 | CCWATCH.CCS[CCWATCH_BLACKOUT].MONITOR = bState; |
||
26 | end |
||
27 | |||
28 | |||
29 | function CCWatchOptions_DruidCCToggle() |
||
30 | local bState = not CCWATCH.MONITORDRUID; |
||
31 | CCWATCH.MONITORDRUID = bState; |
||
32 | CCWatch_Save[CCWATCH.PROFILE].MonitorDruid = bState; |
||
33 | CCWATCH.CCS[CCWATCH_ROOTS].MONITOR = bState; |
||
34 | CCWATCH.CCS[CCWATCH_HIBERNATE].MONITOR = bState; |
||
35 | CCWATCH.CCS[CCWATCH_FERALCHARGE].MONITOR = bState; |
||
36 | CCWATCH.CCS[CCWATCH_POUNCE].MONITOR = bState; |
||
37 | CCWATCH.CCS[CCWATCH_BASH].MONITOR = bState; |
||
38 | CCWATCH.CCS[CCWATCH_IMPSTARFIRE].MONITOR = bState; |
||
39 | end |
||
40 | |||
41 | function CCWatchOptions_HunterCCToggle() |
||
42 | local bState = not CCWATCH.MONITORHUNTER; |
||
43 | CCWATCH.MONITORHUNTER = bState; |
||
44 | CCWatch_Save[CCWATCH.PROFILE].MonitorHunter = bState; |
||
45 | CCWATCH.CCS[CCWATCH_FREEZINGTRAP].MONITOR = bState; |
||
46 | CCWATCH.CCS[CCWATCH_IMPCS].MONITOR = bState; |
||
47 | CCWATCH.CCS[CCWATCH_SCAREBEAST].MONITOR = bState; |
||
48 | CCWATCH.CCS[CCWATCH_SCATTERSHOT].MONITOR = bState; |
||
49 | CCWATCH.CCS[CCWATCH_INTIMIDATION].MONITOR = bState; |
||
50 | end |
||
51 | |||
52 | function CCWatchOptions_PaladinCCToggle() |
||
53 | local bState = not CCWATCH.MONITORPALADIN; |
||
54 | CCWATCH.MONITORPALADIN = bState; |
||
55 | CCWatch_Save[CCWATCH.PROFILE].MonitorPaladin = bState; |
||
56 | CCWATCH.CCS[CCWATCH_HOJ].MONITOR = bState; |
||
57 | CCWATCH.CCS[CCWATCH_REPENTANCE].MONITOR = bState; |
||
58 | CCWATCH.CCS[CCWATCH_TURNUNDEAD].MONITOR = bState; |
||
59 | end |
||
60 | |||
61 | function CCWatchOptions_WarlockCCToggle() |
||
62 | local bState = not CCWATCH.MONITORWARLOCK; |
||
63 | CCWATCH.MONITORWARLOCK = bState; |
||
64 | CCWatch_Save[CCWATCH.PROFILE].MonitorWarlock = bState; |
||
65 | CCWATCH.CCS[CCWATCH_SEDUCE].MONITOR = bState; |
||
66 | CCWATCH.CCS[CCWATCH_FEAR].MONITOR = bState; |
||
67 | CCWATCH.CCS[CCWATCH_BANISH].MONITOR = bState; |
||
68 | CCWATCH.CCS[CCWATCH_HOWLOFTERROR].MONITOR = bState; |
||
69 | CCWATCH.CCS[CCWATCH_DEATHCOIL].MONITOR = bState; |
||
70 | end |
||
71 | |||
72 | function CCWatchOptions_WarriorCCToggle() |
||
73 | local bState = not CCWATCH.MONITORWARRIOR; |
||
74 | CCWATCH.MONITORWARRIOR = bState; |
||
75 | CCWatch_Save[CCWATCH.PROFILE].MonitorWarrior = bState; |
||
76 | CCWATCH.CCS[CCWATCH_INTERCEPT].MONITOR = bState; |
||
77 | CCWATCH.CCS[CCWATCH_MACESPE].MONITOR = bState; |
||
78 | CCWATCH.CCS[CCWATCH_IMPHAMSTRING].MONITOR = bState; |
||
79 | CCWATCH.CCS[CCWATCH_INTIMIDATINGSHOUT].MONITOR = bState; |
||
80 | CCWATCH.CCS[CCWATCH_IMPREVENGE].MONITOR = bState; |
||
81 | CCWATCH.CCS[CCWATCH_CONCUSSIONBLOW].MONITOR = bState; |
||
82 | end |
||
83 | |||
84 | function CCWatchOptions_RogueCCToggle() |
||
85 | local bState = not CCWATCH.MONITORROGUE; |
||
86 | CCWATCH.MONITORROGUE = bState; |
||
87 | CCWatch_Save[CCWATCH.PROFILE].MonitorRogue = bState; |
||
88 | CCWATCH.CCS[CCWATCH_GOUGE].MONITOR = bState; |
||
89 | CCWATCH.CCS[CCWATCH_BLIND].MONITOR = bState; |
||
90 | CCWATCH.CCS[CCWATCH_SAP].MONITOR = bState; |
||
91 | CCWATCH.CCS[CCWATCH_KS].MONITOR = bState; |
||
92 | CCWATCH.CCS[CCWATCH_CS].MONITOR = bState; |
||
93 | end |
||
94 | |||
95 | function CCWatchOptions_MiscCCToggle() |
||
96 | local bState = not CCWATCH.MONITORMISC; |
||
97 | CCWATCH.MONITORMISC = bState; |
||
98 | CCWatch_Save[CCWATCH.PROFILE].MonitorMisc = bState; |
||
99 | CCWATCH.CCS[CCWATCH_WARSTOMP].MONITOR = bState; |
||
100 | CCWATCH.CCS[CCWATCH_SLEEP].MONITOR = bState; |
||
101 | end |
||
102 | |||
103 | function CCWatchOptions_UnlockToggle() |
||
104 | if CCWATCH.STATUS == 2 then |
||
105 | CCWATCH.STATUS = 1; |
||
106 | CCWatch:EnableMouse(0); |
||
107 | CCWatchBar1:Hide(); |
||
108 | CCWatchBar2:Hide(); |
||
109 | CCWatchBar3:Hide(); |
||
110 | CCWatchBar4:Hide(); |
||
111 | CCWatchBar5:Hide(); |
||
112 | CCWatch_AddMessage(CCWATCH_LOCKED); |
||
113 | else |
||
114 | CCWATCH.STATUS = 2; |
||
115 | CCWatch:EnableMouse(1); |
||
116 | CCWatchBar1:Show(); |
||
117 | CCWatchBar2:Show(); |
||
118 | CCWatchBar3:Show(); |
||
119 | CCWatchBar4:Show(); |
||
120 | CCWatchBar5:Show(); |
||
121 | CCWatch_AddMessage(CCWATCH_UNLOCKED); |
||
122 | end |
||
123 | end |
||
124 | |||
125 | function CCWatchOptions_InvertToggle() |
||
126 | CCWATCH.INVERT = not CCWATCH.INVERT; |
||
127 | CCWatch_Save[CCWATCH.PROFILE].invert = CCWATCH.INVERT; |
||
128 | if CCWATCH.INVERT then |
||
129 | CCWatch_AddMessage(CCWATCH_INVERSION_ON); |
||
130 | else |
||
131 | CCWatch_AddMessage(CCWATCH_INVERSION_OFF); |
||
132 | end |
||
133 | end |
||
134 | |||
135 | function CCWatchOptions_ArcanistToggle() |
||
136 | CCWATCH.ARCANIST = not CCWATCH.ARCANIST; |
||
137 | CCWatch_Save[CCWATCH.PROFILE].arcanist = CCWATCH.ARCANIST; |
||
138 | if CCWATCH.ARCANIST then |
||
139 | CCWATCH.CCS[CCWATCH_POLYMORPH].LENGTH = CCWATCH.CCS[CCWATCH_POLYMORPH].LENGTH + 15; |
||
140 | CCWatch_AddMessage(CCWATCH_ARCANIST_ON); |
||
141 | else |
||
142 | CCWATCH.CCS[CCWATCH_POLYMORPH].LENGTH = CCWATCH.CCS[CCWATCH_POLYMORPH].LENGTH - 15; |
||
143 | CCWatch_AddMessage(CCWATCH_ARCANIST_OFF); |
||
144 | end |
||
145 | CCWatchOptionsFrameArcanist:SetChecked(CCWATCH.ARCANIST); |
||
146 | end |
||
147 | |||
148 | |||
149 | function CCWatchOptions_OnLoad() |
||
150 | UIPanelWindows['CCWatchOptionsFrame'] = {area = 'center', pushable = 0}; |
||
151 | end |
||
152 | |||
153 | function CCWatchOptions_Init() |
||
154 | CCWatchOptionsFrameMageCC:SetChecked(CCWATCH.MONITORMAGE); |
||
155 | CCWatchOptionsFramePriestCC:SetChecked(CCWATCH.MONITORPRIEST); |
||
156 | CCWatchOptionsFrameDruidCC:SetChecked(CCWATCH.MONITORDRUID); |
||
157 | CCWatchOptionsFrameHunterCC:SetChecked(CCWATCH.MONITORHUNTER); |
||
158 | CCWatchOptionsFramePaladinCC:SetChecked(CCWATCH.MONITORPALADIN); |
||
159 | CCWatchOptionsFrameWarlockCC:SetChecked(CCWATCH.MONITORWARLOCK); |
||
160 | CCWatchOptionsFrameWarriorCC:SetChecked(CCWATCH.MONITORWARRIOR); |
||
161 | CCWatchOptionsFrameRogueCC:SetChecked(CCWATCH.MONITORROGUE); |
||
162 | CCWatchOptionsFrameMiscCC:SetChecked(CCWATCH.MONITORMISC); |
||
163 | CCWatchSliderAlpha:SetValue(CCWATCH.ALPHA); |
||
164 | CCWatchSliderScale:SetValue(CCWATCH.SCALE); |
||
165 | CCWatchSliderWidth:SetValue(CCWATCH.WIDTH); |
||
166 | |||
167 | CCWatchOptionsFrameUnlock:SetChecked(CCWATCH.STATUS == 2); |
||
168 | CCWatchOptionsFrameInvert:SetChecked(CCWATCH.INVERT); |
||
169 | CCWatchOptionsFrameArcanist:SetChecked(CCWATCH.ARCANIST); |
||
170 | if CCWATCH.ARCANIST then |
||
171 | CCWATCH.CCS[CCWATCH_POLYMORPH].LENGTH = CCWATCH.CCS[CCWATCH_POLYMORPH].LENGTH + 15; |
||
172 | end |
||
173 | |||
174 | if CCWATCH.GROWTH == 0 then |
||
175 | CCWatchGrowthSelectDropDownText:SetText(CCWATCH_OPTION_GROWTH_OFF); |
||
176 | elseif CCWATCH.GROWTH == 1 then |
||
177 | CCWatchGrowthSelectDropDownText:SetText(CCWATCH_OPTION_GROWTH_UP); |
||
178 | else |
||
179 | CCWatchGrowthSelectDropDownText:SetText(CCWATCH_OPTION_GROWTH_DOWN); |
||
180 | end |
||
181 | |||
182 | if CCWATCH.TIMERS == 0 then |
||
183 | CCWatchTimersSelectDropDownText:SetText(CCWATCH_OPTION_TIMERS_OFF); |
||
184 | elseif CCWATCH.TIMERS == 1 then |
||
185 | CCWatchTimersSelectDropDownText:SetText(CCWATCH_OPTION_TIMERS_ON); |
||
186 | else |
||
187 | CCWatchTimersSelectDropDownText:SetText(CCWATCH_OPTION_TIMERS_REVERSE); |
||
188 | end |
||
189 | |||
190 | end |
||
191 | |||
192 | function CCWatchGrowthDropDown_OnInit() |
||
193 | UIDROPDOWNMENU_INIT_MENU = "CCWatch_OptionsMenuGrowthDropDown"; |
||
194 | local info = { }; |
||
195 | |||
196 | info.text = CCWATCH_OPTION_GROWTH_OFF; |
||
197 | info.value = "off"; |
||
198 | info.owner = this; |
||
199 | info.func = CCWatchGrowthDropDown_OnClick; |
||
200 | UIDropDownMenu_AddButton(info); |
||
201 | |||
202 | info.text = CCWATCH_OPTION_GROWTH_UP; |
||
203 | info.value = "up"; |
||
204 | info.owner = this; |
||
205 | info.func = CCWatchGrowthDropDown_OnClick; |
||
206 | UIDropDownMenu_AddButton(info); |
||
207 | |||
208 | info.text = CCWATCH_OPTION_GROWTH_DOWN; |
||
209 | info.value = "down"; |
||
210 | info.owner = this; |
||
211 | info.func = CCWatchGrowthDropDown_OnClick; |
||
212 | UIDropDownMenu_AddButton(info); |
||
213 | end |
||
214 | |||
215 | function CCWatchTimersDropDown_OnInit() |
||
216 | UIDROPDOWNMENU_INIT_MENU = "CCWatch_OptionsMenuTimersDropDown"; |
||
217 | local info = { }; |
||
218 | |||
219 | info.text = CCWATCH_OPTION_TIMERS_OFF; |
||
220 | info.value = "off"; |
||
221 | info.owner = this; |
||
222 | info.func = CCWatchTimersDropDown_OnClick; |
||
223 | UIDropDownMenu_AddButton(info); |
||
224 | |||
225 | info.text = CCWATCH_OPTION_TIMERS_ON; |
||
226 | info.value = "on"; |
||
227 | info.owner = this; |
||
228 | info.func = CCWatchTimersDropDown_OnClick; |
||
229 | UIDropDownMenu_AddButton(info); |
||
230 | |||
231 | info.text = CCWATCH_OPTION_TIMERS_REVERSE; |
||
232 | info.value = "reverse"; |
||
233 | info.owner = this; |
||
234 | info.func = CCWatchTimersDropDown_OnClick; |
||
235 | UIDropDownMenu_AddButton(info); |
||
236 | end |
||
237 | |||
238 | function CCWatchGrowthDropDown_OnClick() |
||
239 | if (this.value == "off") then |
||
240 | CCWatch_Save[CCWATCH.PROFILE].growth = 0; |
||
241 | CCWATCH.GROWTH = CCWatch_Save[CCWATCH.PROFILE].growth; |
||
242 | CCWatchGrowthSelectDropDownText:SetText(CCWATCH_OPTION_GROWTH_OFF); |
||
243 | CCWatch_AddMessage(CCWATCH_GROW_OFF); |
||
244 | elseif( this.value == "up" ) then |
||
245 | CCWatch_Save[CCWATCH.PROFILE].growth = 1; |
||
246 | CCWATCH.GROWTH = CCWatch_Save[CCWATCH.PROFILE].growth; |
||
247 | CCWatchGrowthSelectDropDownText:SetText(CCWATCH_OPTION_GROWTH_UP); |
||
248 | CCWatch_AddMessage(CCWATCH_GROW_UP); |
||
249 | elseif( this.value == "down" ) then |
||
250 | CCWatch_Save[CCWATCH.PROFILE].growth = 2; |
||
251 | CCWATCH.GROWTH = CCWatch_Save[CCWATCH.PROFILE].growth; |
||
252 | CCWatchGrowthSelectDropDownText:SetText(CCWATCH_OPTION_GROWTH_DOWN); |
||
253 | CCWatch_AddMessage(CCWATCH_GROW_DOWN); |
||
254 | end |
||
255 | end |
||
256 | |||
257 | |||
258 | function CCWatchTimersDropDown_OnClick() |
||
259 | if (this.value == "off") then |
||
260 | CCWatch_Save[CCWATCH.PROFILE].timers = 0; |
||
261 | CCWATCH.TIMERS = CCWatch_Save[CCWATCH.PROFILE].timers; |
||
262 | CCWatchTimersSelectDropDownText:SetText(CCWATCH_OPTION_TIMERS_OFF); |
||
263 | CCWatch_AddMessage(CCWATCH_TIMERS_OFF); |
||
264 | elseif( this.value == "on" ) then |
||
265 | CCWatch_Save[CCWATCH.PROFILE].timers = 1; |
||
266 | CCWATCH.TIMERS = CCWatch_Save[CCWATCH.PROFILE].timers; |
||
267 | CCWatchTimersSelectDropDownText:SetText(CCWATCH_OPTION_TIMERS_ON); |
||
268 | CCWatch_AddMessage(CCWATCH_TIMERS_ON); |
||
269 | elseif( this.value == "reverse" ) then |
||
270 | CCWatch_Save[CCWATCH.PROFILE].timers = 2; |
||
271 | CCWATCH.TIMERS = CCWatch_Save[CCWATCH.PROFILE].timers; |
||
272 | CCWatchTimersSelectDropDownText:SetText(CCWATCH_OPTION_TIMERS_REVERSE); |
||
273 | CCWatch_AddMessage(CCWATCH_TIMERS_REVERSE); |
||
274 | end |
||
275 | end |